mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 19:06:35 +03:00
feat: add UIChatListChanged and UIChatListItemChanged events
This commit is contained in:
@@ -485,11 +485,19 @@ impl Context {
|
||||
/// Emits a MsgsChanged event with specified chat and message ids
|
||||
pub fn emit_msgs_changed(&self, chat_id: ChatId, msg_id: MsgId) {
|
||||
self.emit_event(EventType::MsgsChanged { chat_id, msg_id });
|
||||
self.emit_event(EventType::UIChatListChanged);
|
||||
self.emit_event(EventType::UIChatListItemChanged {
|
||||
chat_id: Some(chat_id),
|
||||
});
|
||||
}
|
||||
|
||||
/// Emits an IncomingMsg event with specified chat and message ids
|
||||
pub fn emit_incoming_msg(&self, chat_id: ChatId, msg_id: MsgId) {
|
||||
self.emit_event(EventType::IncomingMsg { chat_id, msg_id });
|
||||
self.emit_event(EventType::UIChatListChanged);
|
||||
self.emit_event(EventType::UIChatListItemChanged {
|
||||
chat_id: Some(chat_id),
|
||||
});
|
||||
}
|
||||
|
||||
/// Returns a receiver for emitted events.
|
||||
|
||||
Reference in New Issue
Block a user