diff --git a/src/contact.rs b/src/contact.rs index 10461be74f..7660edd29e 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -805,7 +805,9 @@ impl Contact { // update the chats the contact that changed their name is part of // (treefit): could make sense to only update chats where the last message is from the contact, but the db query for that is more expensive for chat_id in Contact::get_chats_with_contact(context, &contact_id).await? { - context.emit_event(EventType::UIChatListItemChanged { chat_id: Some(chat_id) }); + context.emit_event(EventType::UIChatListItemChanged { + chat_id: Some(chat_id), + }); } } @@ -1611,6 +1613,7 @@ pub(crate) async fn set_profile_image( if changed { contact.update_param(context).await?; context.emit_event(EventType::ContactsChanged(Some(contact_id))); + // TODO update DM chat } Ok(()) } @@ -1817,6 +1820,7 @@ impl RecentlySeenLoop { // Timeout, notify about contact. if let Some(contact_id) = contact_id { context.emit_event(EventType::ContactsChanged(Some(*contact_id))); + // TODO update DM chat unseen_queue.pop(); } } @@ -1846,6 +1850,7 @@ impl RecentlySeenLoop { // Event is already in the past. if let Some(contact_id) = contact_id { context.emit_event(EventType::ContactsChanged(Some(*contact_id))); + // TODO update DM chat } unseen_queue.pop(); } diff --git a/src/events/payload.rs b/src/events/payload.rs index f18060c42b..cafd2ae3bf 100644 --- a/src/events/payload.rs +++ b/src/events/payload.rs @@ -285,8 +285,8 @@ pub enum EventType { /// Inform UI that a single chat list item changed and needs to be rerendered /// If `chat_id` is set to None, then all currently visible chats need to be rerendered, and all not-visible items need to be cleared from cache if the UI has a cache. - UIChatListItemChanged { + UIChatListItemChanged { /// ID of the changed chat - chat_id: Option + chat_id: Option, }, } diff --git a/src/peerstate.rs b/src/peerstate.rs index a5ae7083e5..1fedc14a8d 100644 --- a/src/peerstate.rs +++ b/src/peerstate.rs @@ -698,7 +698,9 @@ impl Peerstate { context.emit_event(EventType::UIChatListChanged); // update the chats the contact is part of for chat_id in Contact::get_chats_with_contact(context, &contact_id).await? { - context.emit_event(EventType::UIChatListItemChanged { chat_id: Some(chat_id) }); + context.emit_event(EventType::UIChatListItemChanged { + chat_id: Some(chat_id), + }); } Ok(()) }