From 07f2e28eca7ccd3e44d5e7a39b059dcce17563a8 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Mon, 9 Jan 2023 22:12:33 +0100 Subject: [PATCH] fix: only send contact changed event for recently seen if it is relevant (#3938) (no events for contacts that are already offline again) This dramatically speeds up replay after backup import on desktop. --- CHANGELOG.md | 2 +- src/contact.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0ca83889..cf4f53026 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ### API-Changes ### Fixes - +- fix: only send contact changed event for recently seen if it is relevant (not too old to matter) #3938 ## 1.105.0 diff --git a/src/contact.rs b/src/contact.rs index 612b0eee8..4f2189467 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -1416,6 +1416,7 @@ pub(crate) async fn update_last_seen( ) .await? > 0 + && timestamp > time() - SEEN_RECENTLY_SECONDS { context.interrupt_recently_seen(contact_id, timestamp).await; }