From f497e4dd1250520c96836268fce987d7cfd73197 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Fri, 13 Sep 2024 14:01:39 -0300 Subject: [PATCH] docs: Why search_msgs() only looks at the first kilobytes of long messages --- src/context.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/context.rs b/src/context.rs index dd12d6f03..133fd47e8 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1267,6 +1267,12 @@ impl Context { /// /// If `chat_id` is provided this searches only for messages in this chat, if `chat_id` /// is `None` this searches messages from all chats. + /// + /// 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, query: &str) -> Result> { let real_query = query.trim().to_lowercase(); if real_query.is_empty() {