Skip to content

Commit 7242680

Browse files
Contact ordering and graying out RedPhone-only users.
1 parent 8a5c5ef commit 7242680

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Signal/Signal-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</dict>
3939
</array>
4040
<key>CFBundleVersion</key>
41-
<string>2.0.10</string>
41+
<string>2.0.11</string>
4242
<key>LOGS_EMAIL</key>
4343
<string>[email protected]</string>
4444
<key>LOGS_URL</key>

Signal/src/contact/ContactsManager.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,19 @@ -(NSArray*) contactsForContactIds:(NSArray *)contactIds {
381381
#pragma mark - Whisper User Management
382382

383383
-(NSArray*) getSignalUsersFromContactsArray:(NSArray*)contacts {
384-
return [contacts filter:^int(Contact* contact) {
384+
return [[contacts filter:^int(Contact* contact) {
385385
return [self isContactRegisteredWithRedPhone:contact] || contact.isTextSecureContact;
386+
}]sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
387+
Contact *contact1 = (Contact*)obj1;
388+
Contact *contact2 = (Contact*)obj2;
389+
390+
BOOL firstNameOrdering = ABPersonGetSortOrdering() == kABPersonCompositeNameFormatFirstNameFirst?YES:NO;
391+
392+
if (firstNameOrdering) {
393+
return [contact1.firstName compare:contact2.firstName];
394+
} else {
395+
return [contact1.lastName compare:contact2.lastName];
396+
}
386397
}];
387398
}
388399

Signal/src/views/ContactTableViewCell.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ - (void)configureWithContact:(Contact *)contact {
3333
_associatedContact = contact;
3434

3535
_nameLabel.attributedText = [self attributedStringForContact:contact];
36+
if (!contact.isTextSecureContact) {
37+
_nameLabel.textColor = [UIColor grayColor];
38+
}
3639
}
3740

3841
- (NSAttributedString *)attributedStringForContact:(Contact *)contact {

0 commit comments

Comments
 (0)