From 936fbd27c2ed1f2a33fe8173e35717014a4e78f0 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Fri, 25 Feb 2022 15:18:27 +1100 Subject: [PATCH] fix message request notification --- Session/Notifications/AppNotifications.swift | 2 +- .../NSENotificationPresenter.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Session/Notifications/AppNotifications.swift b/Session/Notifications/AppNotifications.swift index c01df8faf..c4118e3a6 100644 --- a/Session/Notifications/AppNotifications.swift +++ b/Session/Notifications/AppNotifications.swift @@ -171,7 +171,7 @@ public class NotificationPresenter: NSObject, NotificationsProtocol { let numMessageRequests = threads.numberOfItems(inGroup: TSMessageRequestGroup) // Allow this to show a notification if there are no message requests (ie. this is the first one) - guard numMessageRequests <= 1 else { return } + guard numMessageRequests == 0 else { return } } else if thread.isMessageRequest() && CurrentAppContext().appUserDefaults()[.hasHiddenMessageRequests] { // If there are other interactions on this thread already then don't show the notification diff --git a/SessionNotificationServiceExtension/NSENotificationPresenter.swift b/SessionNotificationServiceExtension/NSENotificationPresenter.swift index 8cf6eaca8..ea04e9975 100644 --- a/SessionNotificationServiceExtension/NSENotificationPresenter.swift +++ b/SessionNotificationServiceExtension/NSENotificationPresenter.swift @@ -18,7 +18,7 @@ public class NSENotificationPresenter: NSObject, NotificationsProtocol { let numMessageRequests = threads.numberOfItems(inGroup: TSMessageRequestGroup) // Allow this to show a notification if there are no message requests (ie. this is the first one) - guard numMessageRequests <= 1 else { return } + guard numMessageRequests == 0 else { return } } else if thread.isMessageRequest() && CurrentAppContext().appUserDefaults()[.hasHiddenMessageRequests] { // If there are other interactions on this thread already then don't show the notification