mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 14:36:29 +03:00
fix: Fix emitting ContactsChanged events on "recently seen" status change (#5377)
- Always emit `ContactsChanged` from `contact::update_last_seen()` if a contact was seen recently just for simplicity and symmetry with `RecentlySeenLoop::run()` which also may emit several events for single contact. - Fix sleep time calculation in `RecentlySeenLoop::run()` -- `now` must be updated on every iteration, before the initial value was used every time which led to progressively long sleeps.
This commit is contained in:
@@ -1100,7 +1100,10 @@ fn print_event(event: &Event) {
|
||||
"Received MSGS_CHANGED(chat_id={chat_id}, msg_id={msg_id})",
|
||||
))
|
||||
),
|
||||
EventType::ContactsChanged(_) => format!("{}", green.paint("Received CONTACTS_CHANGED()")),
|
||||
EventType::ContactsChanged(contact) => format!(
|
||||
"{}",
|
||||
green.paint(format!("Received CONTACTS_CHANGED(contact={contact:?})"))
|
||||
),
|
||||
EventType::LocationChanged(contact) => format!(
|
||||
"{}",
|
||||
green.paint(format!("Received LOCATION_CHANGED(contact={contact:?})"))
|
||||
|
||||
Reference in New Issue
Block a user