Extract labels for phone numbers.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 9dc6014850
commit e3c9598122

@ -60,6 +60,8 @@ typedef NS_ENUM(NSUInteger, OWSPhoneNumberType) {
- (instancetype)initWithContact:(CNContact *)contact;
- (OWSPhoneNumberType)phoneNumberTypeForPhoneNumber:(NSString *)recipientId;
#endif // TARGET_OS_IOS
+ (NSComparator)comparatorSortingNamesByFirstThenLast:(BOOL)firstNameOrdering;

@ -229,6 +229,19 @@ NS_ASSUME_NONNULL_BEGIN
};
}
- (OWSPhoneNumberType)phoneNumberTypeForPhoneNumber:(NSString *)recipientId
{
OWSAssert(recipientId.length > 0);
OWSAssert([self.textSecureIdentifiers containsObject:recipientId]);
NSNumber *value = self.phoneNumberTypeMap[recipientId];
OWSAssert(value);
if (!value) {
return OWSPhoneNumberTypeUnknown;
}
return (OWSPhoneNumberType)value.intValue;
}
@end
NS_ASSUME_NONNULL_END

Loading…
Cancel
Save