When sending or receiving a large amount of text, the message is shortened, and only the shortened version falls under the search, I would like to find the entire text in the search, it is very necessary for work.
Also, when opening an abbreviated text, it turns out like a page, there are no text transfer, <br>
, but it does not exist in regular text. And when copying this message, it copies only the shortened version. I’m not talking about copying by highlighting from android, but from the functionality of the DC interface, which in principle should copy the entire message to the buffer.
There’s a comment in the code:
/// NB: Wrt the search in long messages which are shown truncated with the "Show Full Message…"
/// button, we only look at the first several kilobytes. Let's not fix this -- one can send a
/// dictionary in the message that matches any reasonable search request, but the user won't see
/// the match because they should tap on "Show Full Message…" for that. Probably such messages
/// would only clutter search results.
pub async fn search_msgs(&self, chat_id: Option<ChatId>, query: &str) -> Result<Vec<MsgId>> {
There are several reasons for this:
- The full text of long messages is only stored in another column
msgs.mime_headers
, but it’s not only text, but the whole decrypted message with headers, maybe even HTML, and it’s compressed to reduce the db size. So it’s not so easy to search there technically. - Even if the core will search text there, UIs wouldn’t show search matches properly, the user would need to click on the match, then on “Show Full Message…” in the chat and then search the text again in the showed up window.
Still if we want this feature, such a search should be optional. This way we can avoid excessive CPU usage and not show the Cambridge dictionary in the search results every time.
EDIT: I forgot about the msgs.txt_raw
column which contains Subject and (if the message text was truncated) the message part body, so we can search there. Still, the apps won’t show matches properly (they only look msgs.txt
) and maybe we want to compress msgs.txt_raw
as well.