mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Contact ordering and graying out RedPhone-only users.
This commit is contained in:
parent
8a5c5efd73
commit
7242680464
3 changed files with 16 additions and 2 deletions
|
@ -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>
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
_associatedContact = contact;
|
||||
|
||||
_nameLabel.attributedText = [self attributedStringForContact:contact];
|
||||
if (!contact.isTextSecureContact) {
|
||||
_nameLabel.textColor = [UIColor grayColor];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSAttributedString *)attributedStringForContact:(Contact *)contact {
|
||||
|
|
Loading…
Reference in a new issue