Contact ordering and graying out RedPhone-only users.

This commit is contained in:
Frederic Jacobs 2015-01-31 02:26:38 -10:00
parent 8a5c5efd73
commit 7242680464
3 changed files with 16 additions and 2 deletions

View file

@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2.0.10</string>
<string>2.0.11</string>
<key>LOGS_EMAIL</key>
<string>support@whispersystems.org</string>
<key>LOGS_URL</key>

View file

@ -381,8 +381,19 @@ void onAddressBookChanged(ABAddressBookRef notifyAddressBook, CFDictionaryRef in
#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];
}
}];
}

View file

@ -33,6 +33,9 @@
_associatedContact = contact;
_nameLabel.attributedText = [self attributedStringForContact:contact];
if (!contact.isTextSecureContact) {
_nameLabel.textColor = [UIColor grayColor];
}
}
- (NSAttributedString *)attributedStringForContact:(Contact *)contact {