globally search for media#3528
Conversation
|
one thing @adbenitez pointed out in dev chat, is that this approach does not care for duplicates - in a selector you maybe do not want to have them. however, unless there is a dead-simple approach, to allow UI to move forward, it probably makes sense to care for that at some later point in a subsequent pr. also, there is the rough idea of files deduplication, this may help somehow as well ;) |
| let chat_id = if chat_id == 0 { | ||
| None | ||
| } else { | ||
| Some(ChatId::new(chat_id)) | ||
| }; |
There was a problem hiding this comment.
api wise I would prefer changing line 583 to chat_id: Option<u32>
and then using map to convert it:
| let chat_id = if chat_id == 0 { | |
| None | |
| } else { | |
| Some(ChatId::new(chat_id)) | |
| }; | |
| let chat_id = chat_id.map(|id| ChatId::new(id)); |
There was a problem hiding this comment.
that way I can pass null in the js api instead of the number 0 which is a bit more clear IMO
There was a problem hiding this comment.
but not too important, its already ok
There was a problem hiding this comment.
api wise I would prefer changing line 583 to chat_id: Option
and then using map to convert it:
feel free to push to this pr or do a subsequent one - i was changing up to the existing api only as i do not want to touch the desktop code at all and keep this pr scoped to the rust core part.
There was a problem hiding this comment.
I mentioned it mostly that you know that its an option too, Option<type> gets translated basically to type | null
|
EDIT: pushed a fix. |
this fixes the issue that drafts and other hidden messages pop up in the gallery.
and also still allow `0` for dev convenience (though I'm not totally sure if thats the right decision)
91fb32d to
3c03bbb
Compare
|
k, then let's merge that in to go forward with deltachat/deltachat-ios#1668 :) |
this pr allows passing
0todc_get_chat_media(), the function returns media from any chat then - similar todc_search_msgs().moreover, this pr fixes a minor issue to not return hidden media - and a test (
dc_get_chat_media()was completely untested)closes #3527