mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 18:06:35 +03:00
Avoid ChatId::is_unset for searching messages
Using a ChatId value of 0 to indicate global search is a left over from C-land. Refactor this to be an option instead.
This commit is contained in:
@@ -858,9 +858,9 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
|
||||
ensure!(!arg1.is_empty(), "Argument <query> missing.");
|
||||
|
||||
let chat = if let Some(ref sel_chat) = sel_chat {
|
||||
sel_chat.get_id()
|
||||
Some(sel_chat.get_id())
|
||||
} else {
|
||||
ChatId::new(0)
|
||||
None
|
||||
};
|
||||
|
||||
let msglist = context.search_msgs(chat, arg1).await;
|
||||
|
||||
Reference in New Issue
Block a user