@@ -121,24 +121,60 @@ - (void)updateTableContents
121121
122122 OWSTableContents *contents = [OWSTableContents new ];
123123
124- __weak ShowGroupMembersViewController *weakSelf = self;
125124 ContactsViewHelper *helper = self.contactsViewHelper ;
126125
126+ OWSTableSection *membersSection = [OWSTableSection new ];
127+
127128 // Group Members
128129
129- OWSTableSection *section = [OWSTableSection new ];
130+ // If there are "no longer verified" members of the group,
131+ // highlight them in a special section.
132+ NSSet <NSString *> *noLongerVerifiedRecipientIds = [NSSet setWithArray: [self noLongerVerifiedRecipientIds ]];
133+ if (noLongerVerifiedRecipientIds.count > 0 ) {
134+ OWSTableSection *noLongerVerifiedSection = [OWSTableSection new ];
135+ noLongerVerifiedSection.headerTitle = NSLocalizedString(@" GROUP_MEMBERS_SECTION_TITLE_NO_LONGER_VERIFIED" ,
136+ @" Title for the 'no longer verified' section of the 'group members' view." );
137+ membersSection.headerTitle = NSLocalizedString(
138+ @" GROUP_MEMBERS_SECTION_TITLE_MEMBERS" , @" Title for the 'members' section of the 'group members' view." );
139+ [self addMembers: noLongerVerifiedRecipientIds.allObjects
140+ toSection: noLongerVerifiedSection
141+ noLongerVerifiedRecipientIds: noLongerVerifiedRecipientIds];
142+ [contents addSection: noLongerVerifiedSection];
143+ }
130144
131145 NSMutableSet *memberRecipientIds = [self .memberRecipientIds mutableCopy ];
132146 [memberRecipientIds removeObject: [helper localNumber ]];
133- for (NSString *recipientId in [memberRecipientIds.allObjects sortedArrayUsingSelector: @selector (compare: )]) {
147+ [self addMembers: memberRecipientIds.allObjects
148+ toSection: membersSection
149+ noLongerVerifiedRecipientIds: noLongerVerifiedRecipientIds];
150+ [contents addSection: membersSection];
151+
152+ self.contents = contents;
153+ }
154+
155+ - (void )addMembers : (NSArray <NSString *> *)recipientIds
156+ toSection : (OWSTableSection *)section
157+ noLongerVerifiedRecipientIds : (NSSet <NSString *> *)noLongerVerifiedRecipientIds
158+ {
159+ OWSAssert (recipientIds);
160+ OWSAssert (section);
161+ OWSAssert (noLongerVerifiedRecipientIds);
162+
163+ __weak ShowGroupMembersViewController *weakSelf = self;
164+ ContactsViewHelper *helper = self.contactsViewHelper ;
165+ for (NSString *recipientId in [recipientIds sortedArrayUsingSelector: @selector (compare: )]) {
134166 [section addItem: [OWSTableItem itemWithCustomCellBlock: ^{
135167 ShowGroupMembersViewController *strongSelf = weakSelf;
136168 OWSAssert (strongSelf);
137169
138170 ContactTableViewCell *cell = [ContactTableViewCell new ];
139171 SignalAccount *signalAccount = [helper signalAccountForRecipientId: recipientId];
172+ BOOL isNoLongerVerified = [noLongerVerifiedRecipientIds containsObject: recipientId];
140173 BOOL isBlocked = [helper isRecipientIdBlocked: recipientId];
141- if (isBlocked) {
174+ if (isNoLongerVerified) {
175+ cell.accessoryMessage = NSLocalizedString(
176+ @" CONTACT_CELL_IS_NO_LONGER_VERIFIED" , @" An indicator that a contact is no longer verified." );
177+ } else if (isBlocked) {
142178 cell.accessoryMessage
143179 = NSLocalizedString(@" CONTACT_CELL_IS_BLOCKED" , @" An indicator that a contact has been blocked." );
144180 }
@@ -162,9 +198,19 @@ - (void)updateTableContents
162198 [weakSelf didSelectRecipientId: recipientId];
163199 }]];
164200 }
165- [contents addSection: section];
201+ }
166202
167- self.contents = contents;
203+ // Returns a collection of the group members who are "no longer verified".
204+ - (NSArray <NSString *> *)noLongerVerifiedRecipientIds
205+ {
206+ NSMutableArray <NSString *> *result = [NSMutableArray new ];
207+ for (NSString *recipientId in self.thread .recipientIdentifiers ) {
208+ if ([[OWSIdentityManager sharedManager ] verificationStateForRecipientId: recipientId]
209+ == OWSVerificationStateNoLongerVerified) {
210+ [result addObject: recipientId];
211+ }
212+ }
213+ return [result copy ];
168214}
169215
170216- (void )didSelectRecipientId : (NSString *)recipientId
0 commit comments