From 66e7df22bbefce09a40365a9af0411e9d553fb92 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 24 May 2021 08:53:27 +1000 Subject: [PATCH] Don't notify for closed group control messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This addresses an issue where: • someone would create a closed group • on other peoples' devices this control message would be received through a background poll or a push notification • the received message timestamps table would be updated • processing wouldn't be finished (during a background poll or while handling a push notification the system can cut you off at any time) • some of the added users don't see the new closed group because when they open the app and get the control message from their swarm it's considered a duplicate and isn't processed again --- .../libsession/messaging/sending_receiving/MessageSender.kt | 2 ++ .../messaging/sending_receiving/pollers/ClosedGroupPollerV2.kt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt index 23b0df99c0..1b1edf2473 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSender.kt @@ -163,9 +163,11 @@ object MessageSender { } handleSuccessfulMessageSend(message, destination, isSyncMessage) var shouldNotify = (message is VisibleMessage && !isSyncMessage) + /* if (message is ClosedGroupControlMessage && message.kind is ClosedGroupControlMessage.Kind.New) { shouldNotify = true } + */ if (shouldNotify) { val notifyPNServerJob = NotifyPNServerJob(snodeMessage) JobQueue.shared.add(notifyPNServerJob) diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/pollers/ClosedGroupPollerV2.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/pollers/ClosedGroupPollerV2.kt index c0da73798c..bad77caadf 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/pollers/ClosedGroupPollerV2.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/pollers/ClosedGroupPollerV2.kt @@ -28,7 +28,7 @@ class ClosedGroupPollerV2 { companion object { private val minPollInterval = 4 * 1000 - private val maxPollInterval = 2 * 60 * 1000 + private val maxPollInterval = 4 * 60 * 1000 @JvmStatic val shared = ClosedGroupPollerV2()