From aa3a18fa7ee6305ce733b412848544624783fd8c Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 24 May 2021 08:57:31 +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 --- SessionMessagingKit/Sending & Receiving/MessageSender.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SessionMessagingKit/Sending & Receiving/MessageSender.swift b/SessionMessagingKit/Sending & Receiving/MessageSender.swift index 5c213883c..089ea6a34 100644 --- a/SessionMessagingKit/Sending & Receiving/MessageSender.swift +++ b/SessionMessagingKit/Sending & Receiving/MessageSender.swift @@ -212,9 +212,11 @@ public final class MessageSender : NSObject { storage.write(with: { transaction in MessageSender.handleSuccessfulMessageSend(message, to: destination, isSyncMessage: isSyncMessage, using: transaction) var shouldNotify = (message is VisibleMessage && !isSyncMessage) + /* if let closedGroupControlMessage = message as? ClosedGroupControlMessage, case .new = closedGroupControlMessage.kind { shouldNotify = true } + */ if shouldNotify { let notifyPNServerJob = NotifyPNServerJob(message: snodeMessage) if isMainAppAndActive {