mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-02 11:19:30 +00:00
Better management of search for display name
This commit is contained in:
parent
076d0c31ae
commit
a375e855c7
1 changed files with 3 additions and 4 deletions
|
|
@ -300,8 +300,11 @@ void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info, void
|
|||
+ (NSString *)displayNameForAddress:(const LinphoneAddress *)addr {
|
||||
NSString *ret = NSLocalizedString(@"Unknown", nil);
|
||||
Contact *contact = [FastAddressBook getContactWithAddress:addr];
|
||||
LinphoneFriend *friend = linphone_core_find_friend(LC, addr);
|
||||
if (contact) {
|
||||
ret = [FastAddressBook displayNameForContact:contact];
|
||||
} else if (friend) {
|
||||
ret = [NSString stringWithUTF8String:linphone_friend_get_name(friend)];
|
||||
} else {
|
||||
const char *lDisplayName = linphone_address_get_display_name(addr);
|
||||
const char *lUserName = linphone_address_get_username(addr);
|
||||
|
|
@ -311,10 +314,6 @@ void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info, void
|
|||
ret = [NSString stringWithUTF8String:lUserName];
|
||||
}
|
||||
}
|
||||
LinphoneFriend *friend = linphone_core_find_friend(LC, addr);
|
||||
if (friend) {
|
||||
ret = [NSString stringWithUTF8String:linphone_friend_get_name(friend)];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue