mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 00:16:34 +03:00
globally search for media (#3528)
* get_chat_media() from any chat similar to search_msgs() * do not return hidden media this fixes the issue that drafts and other hidden messages pop up in the gallery. * add a test for get_chat_media() * use None instead of ChatId::new(0) * clarify scope of 'any' in get_chat_media() * adapt json rpc to changed get_chat_media() * jsonrpc: chat_get_media turn chat_id into option and also still allow `0` for dev convenience (though I'm not totally sure if thats the right decision) * cargo fmt Co-authored-by: Simon Laux <mobile.info@simonlaux.de>
This commit is contained in:
@@ -983,11 +983,9 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
|
||||
chat::add_device_msg(&context, None, Some(&mut msg)).await?;
|
||||
}
|
||||
"listmedia" => {
|
||||
ensure!(sel_chat.is_some(), "No chat selected.");
|
||||
|
||||
let images = chat::get_chat_media(
|
||||
&context,
|
||||
sel_chat.as_ref().unwrap().get_id(),
|
||||
sel_chat.map(|c| c.id),
|
||||
Viewtype::Image,
|
||||
Viewtype::Gif,
|
||||
Viewtype::Video,
|
||||
|
||||
Reference in New Issue
Block a user