Commit 62195a72 authored by Benjamin REIS's avatar Benjamin REIS

clearer method

parent 27625e5b
......@@ -568,7 +568,7 @@
}
LinphoneNatPolicy *policy = linphone_proxy_config_get_nat_policy(proxyCfg) ?: linphone_core_create_nat_policy(LC);
linphone_nat_policy_enable_stun(policy, use_ice); /*we always use STUN with ICE*/
linphone_nat_policy_enable_stun(policy, use_ice); // We always use STUN with ICE
linphone_nat_policy_enable_ice(policy, use_ice);
linphone_nat_policy_set_stun_server(policy, stun_preference.UTF8String);
linphone_proxy_config_set_nat_policy(proxyCfg, policy);
......
......@@ -289,25 +289,23 @@
}
+ (NSString *)displayNameForAddress:(const LinphoneAddress *)addr {
NSString *ret = NSLocalizedString(@"Unknown", nil);
Contact *contact = [FastAddressBook getContactWithAddress:addr];
if (contact) {
ret = [FastAddressBook displayNameForContact:contact];
} else {
LinphoneFriend *friend = linphone_core_find_friend(LC, addr);
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);
if (lDisplayName) {
ret = [NSString stringWithUTF8String:lDisplayName];
} else if (lUserName) {
ret = [NSString stringWithUTF8String:lUserName];
}
}
}
return ret;
if (contact)
return [FastAddressBook displayNameForContact:contact];
LinphoneFriend *friend = linphone_core_find_friend(LC, addr);
if (friend)
return [NSString stringWithUTF8String:linphone_friend_get_name(friend)];
const char *displayName = linphone_address_get_display_name(addr);
if (displayName)
return [NSString stringWithUTF8String:displayName];
const char *userName = linphone_address_get_username(addr);
if (userName)
return [NSString stringWithUTF8String:userName];
return NSLocalizedString(@"Unknown", nil);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment