fix displayname of incoming call

This commit is contained in:
Danmei Chen 2020-07-14 18:53:52 +02:00
parent 7c1f9968fe
commit 91b0c38a2f
2 changed files with 3 additions and 3 deletions

View file

@ -126,7 +126,7 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) {
return name2ASCII;
}
}
return nil;
return NSLocalizedString(@"Unknown", nil);
}
- (void)loadData {
@ -186,7 +186,7 @@ static int ms_strcmpfuz(const char *fuzzy_word, const char *sentence) {
add = (contact.emails.count > 0);
}
NSMutableString *name = [self displayNameForContact:contact] ? [[NSMutableString alloc] initWithString: [self displayNameForContact:contact]] : nil;
NSMutableString *name = [[NSMutableString alloc] initWithString: [self displayNameForContact:contact]];
if (add && name != nil) {
NSString *firstChar = [[name substringToIndex:1] uppercaseString];
// Put in correct subAr

View file

@ -318,7 +318,7 @@
+ (NSString *)displayNameForAddress:(const LinphoneAddress *)addr {
Contact *contact = [FastAddressBook getContactWithAddress:addr];
if (contact)
if (contact && ![contact.displayName isEqualToString:@""])
return [FastAddressBook displayNameForContact:contact];
LinphoneFriend *friend = linphone_core_find_friend(LC, addr);