Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Laux committed Jan 11, 2024
1 parent a76a7ae commit 7483aa5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/contact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
}
}

Expand Down Expand Up @@ -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(())
}
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions src/events/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChatId>
chat_id: Option<ChatId>,
},
}
4 changes: 3 additions & 1 deletion src/peerstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down

0 comments on commit 7483aa5

Please sign in to comment.