Skip to content

Commit

Permalink
Contact ordering and graying out RedPhone-only users.
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericJacobs committed Jan 31, 2015
1 parent 8a5c5ef commit 7242680
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Signal/Signal-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2.0.10</string>
<string>2.0.11</string>
<key>LOGS_EMAIL</key>
<string>[email protected]</string>
<key>LOGS_URL</key>
Expand Down
13 changes: 12 additions & 1 deletion Signal/src/contact/ContactsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,19 @@ -(NSArray*) contactsForContactIds:(NSArray *)contactIds {
#pragma mark - Whisper User Management

-(NSArray*) getSignalUsersFromContactsArray:(NSArray*)contacts {
return [contacts filter:^int(Contact* contact) {
return [[contacts filter:^int(Contact* contact) {
return [self isContactRegisteredWithRedPhone:contact] || contact.isTextSecureContact;
}]sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
Contact *contact1 = (Contact*)obj1;
Contact *contact2 = (Contact*)obj2;

BOOL firstNameOrdering = ABPersonGetSortOrdering() == kABPersonCompositeNameFormatFirstNameFirst?YES:NO;

if (firstNameOrdering) {
return [contact1.firstName compare:contact2.firstName];
} else {
return [contact1.lastName compare:contact2.lastName];
}
}];
}

Expand Down
3 changes: 3 additions & 0 deletions Signal/src/views/ContactTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ - (void)configureWithContact:(Contact *)contact {
_associatedContact = contact;

_nameLabel.attributedText = [self attributedStringForContact:contact];
if (!contact.isTextSecureContact) {
_nameLabel.textColor = [UIColor grayColor];
}
}

- (NSAttributedString *)attributedStringForContact:(Contact *)contact {
Expand Down

0 comments on commit 7242680

Please sign in to comment.