From e48d51d08496ef4fd3afdb554bb0078a934f5ec8 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 23 Jun 2017 14:18:17 -0400 Subject: [PATCH] Respond to CR. // FREEBIE --- Signal/src/environment/NotificationsManager.m | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Signal/src/environment/NotificationsManager.m b/Signal/src/environment/NotificationsManager.m index 88edf3359..13fd350b7 100644 --- a/Signal/src/environment/NotificationsManager.m +++ b/Signal/src/environment/NotificationsManager.m @@ -264,12 +264,20 @@ switch (self.notificationPreviewType) { case NotificationNamePreview: { - BOOL senderIsNoLongerVerified = - [OWSIdentityManager.sharedManager verificationStateForRecipientId:message.authorId] - == OWSVerificationStateNoLongerVerified; - notification.category = (senderIsNoLongerVerified ? Signal_Full_New_Message_Category_No_Longer_Verified - : Signal_Full_New_Message_Category); + // Don't reply from lockscreen if anyone in this conversation is + // "no longer verified". + BOOL isNoLongerVerified = NO; + for (NSString *recipientId in thread.recipientIdentifiers) { + if ([OWSIdentityManager.sharedManager verificationStateForRecipientId:recipientId] + == OWSVerificationStateNoLongerVerified) { + isNoLongerVerified = YES; + break; + } + } + + notification.category = (isNoLongerVerified ? Signal_Full_New_Message_Category_No_Longer_Verified + : Signal_Full_New_Message_Category); notification.userInfo = @{Signal_Thread_UserInfo_Key : thread.uniqueId, Signal_Message_UserInfo_Key : message.uniqueId};