From d0947b83a94e6becf54c8da0dc6c5b6831bba3df Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Thu, 16 Sep 2021 10:32:23 +1000 Subject: [PATCH] cancel specific notification if there is an identifier --- Session/Notifications/AppNotifications.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Session/Notifications/AppNotifications.swift b/Session/Notifications/AppNotifications.swift index ba078de92..8b0ad47c5 100644 --- a/Session/Notifications/AppNotifications.swift +++ b/Session/Notifications/AppNotifications.swift @@ -139,7 +139,11 @@ public class NotificationPresenter: NSObject, NotificationsProtocol { switch notification.object { case let incomingMessage as TSIncomingMessage: Logger.debug("canceled notification for message: \(incomingMessage)") - cancelNotifications(threadId: incomingMessage.uniqueThreadId) + if let identifier = incomingMessage.notificationIdentifier { + cancelNotification(identifier) + } else { + cancelNotifications(threadId: incomingMessage.uniqueThreadId) + } default: break }