diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index c8debe196..11ba8b5cc 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -5141,8 +5141,8 @@ void dc_event_unref(dc_event_t* event); * - Chats created, deleted or archived * - A draft has been set * - * @param data1 (int) chat_id for single added messages - * @param data2 (int) msg_id for single added messages + * @param data1 (int) chat_id if only a single chat is affected by the changes, otherwise 0 + * @param data2 (int) msg_id if only a single message is affected by the changes, otherwise 0 */ #define DC_EVENT_MSGS_CHANGED 2000 diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index 4f8496ac9..94b19f50c 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -327,7 +327,12 @@ pub(crate) async fn dc_receive_imf_inner( } } - if let Some(create_event_to_send) = create_event_to_send { + if replace_partial_download { + context.emit_event(EventType::MsgsChanged { + msg_id: MsgId::new(0), + chat_id, + }); + } else if let Some(create_event_to_send) = create_event_to_send { for (chat_id, msg_id) in created_db_entries { let event = match create_event_to_send { CreateEvent::MsgsChanged => EventType::MsgsChanged { msg_id, chat_id }, diff --git a/src/events.rs b/src/events.rs index 390707a32..9356f9e5f 100644 --- a/src/events.rs +++ b/src/events.rs @@ -203,7 +203,8 @@ pub enum EventType { /// - Chats created, deleted or archived /// - A draft has been set /// - /// The `chat_id` and `msg_id` values will be 0 if more than one message is changed. + /// `chat_id` is set if only a single chat is affected by the changes, otherwise 0. + /// `msg_id` is set if only a single message is affected by the changes, otherwise 0. #[strum(props(id = "2000"))] MsgsChanged { chat_id: ChatId, msg_id: MsgId },