mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-31 18:29:29 +00:00
settings: dont parse username as phone number by default
This commit is contained in:
parent
d8b61fdd55
commit
24119a2d51
3 changed files with 20 additions and 3 deletions
|
|
@ -238,6 +238,21 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
new_config = linphone_account_creator_configure(account_creator);
|
||||
|
||||
if (new_config) {
|
||||
BOOL usePhoneNumber = [LinphoneManager.instance lpConfigBoolForKey:@"use_phone_number"];
|
||||
if (usePhoneNumber) {
|
||||
char *user = linphone_proxy_config_normalize_phone_number(
|
||||
new_config, linphone_account_creator_get_username(account_creator));
|
||||
if (user) {
|
||||
LinphoneAddress *addr = linphone_address_clone(linphone_proxy_config_get_identity_address(new_config));
|
||||
linphone_address_set_username(addr, user);
|
||||
linphone_proxy_config_edit(new_config);
|
||||
linphone_proxy_config_set_identity_address(new_config, addr);
|
||||
linphone_proxy_config_done(new_config);
|
||||
linphone_address_destroy(addr);
|
||||
ms_free(user);
|
||||
}
|
||||
}
|
||||
|
||||
[lm configurePushTokenForProxyConfig:new_config];
|
||||
linphone_core_set_default_proxy_config(LC, new_config);
|
||||
// reload address book to prepend proxy config domain to contacts' phone number
|
||||
|
|
|
|||
|
|
@ -485,8 +485,10 @@
|
|||
LinphoneAddress *linphoneAddress = linphone_core_interpret_url(LC, "sip:user@domain.com");
|
||||
if ([LinphoneManager.instance lpConfigBoolForKey:@"use_phone_number" inSection:@"assistant"]) {
|
||||
char *user = linphone_proxy_config_normalize_phone_number(proxyCfg, username.UTF8String);
|
||||
linphone_address_set_username(linphoneAddress, user);
|
||||
ms_free(user);
|
||||
if (user) {
|
||||
linphone_address_set_username(linphoneAddress, user);
|
||||
ms_free(user);
|
||||
}
|
||||
}
|
||||
linphone_address_set_domain(linphoneAddress, [domain UTF8String]);
|
||||
linphone_address_set_display_name(linphoneAddress, (displayName.length ? displayName.UTF8String : NULL));
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit e1f34777d4cdc4066f626cff999ce6dff4157f22
|
||||
Subproject commit 0feee4b5bb3971463545f26eb8b32dba62053abc
|
||||
Loading…
Add table
Reference in a new issue