Don't notify for closed group control messages

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
pull/417/head
Niels Andriesse 3 years ago
parent 641a3f4d06
commit aa3a18fa7e

@ -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 {

Loading…
Cancel
Save