Commit 9bcf4072 authored by DanmeiChen's avatar DanmeiChen
Browse files

fix build with master

parent 8a689af7
Pipeline #27422 failed with stage
in 13 seconds
......@@ -240,10 +240,10 @@ typedef enum { ContactsAll, ContactsLinphone, ContactsMAX } ContactsCategory;
cell.controller = self;
cell.uri = uri;
LinphoneAddress *addr = NULL;
LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC);
if (cfg && linphone_proxy_config_is_phone_number(cfg, uri.UTF8String)) {
char *phone = linphone_proxy_config_normalize_phone_number(cfg, uri.UTF8String);
addr = linphone_proxy_config_normalize_sip_uri(cfg, phone);
LinphoneAccount *account = linphone_core_get_default_account(LC);
if (account && linphone_account_is_phone_number(account, uri.UTF8String)) {
char *phone = linphone_account_normalize_phone_number(account, uri.UTF8String);
addr = linphone_account_normalize_sip_uri(account, phone);
ms_free(phone);
} else
addr = linphone_address_new(uri.UTF8String);
......
......@@ -153,7 +153,7 @@
if (([username rangeOfString:@"@"].length > 0) &&
([LinphoneManager.instance lpConfigBoolForKey:@"show_contacts_emails_preference"] == true)) {
[_tableController addEmailField:username];
} else if ((linphone_proxy_config_is_phone_number(NULL, [username UTF8String])) &&
} else if ((linphone_account_is_phone_number(NULL, [username UTF8String])) &&
([LinphoneManager.instance lpConfigBoolForKey:@"save_new_contacts_as_phone_number"] == true)) {
[_tableController addPhoneField:username];
} else {
......
......@@ -969,7 +969,7 @@
if (isDefault) {
// if we removed the default proxy config, set another one instead
if (linphone_core_get_proxy_config_list(LC) != NULL) {
linphone_core_set_default_proxy_index(LC, 0);
linphone_core_set_default_proxy_config(LC, (LinphoneProxyConfig *)(linphone_core_get_proxy_config_list(LC)->data));
}
}
[self transformLinphoneCoreToKeys];
......
......@@ -45,9 +45,9 @@
- (void)setAddress:(NSString *)address {
_addressLabel.text = _editTextfield.text = address;
char *normAddr = (char *)_addressLabel.text.UTF8String;
LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC);
if(_addressLabel.text && cfg && linphone_proxy_config_is_phone_number(cfg, _addressLabel.text.UTF8String)) {
normAddr = linphone_proxy_config_normalize_phone_number(cfg,
LinphoneAccount *account = linphone_core_get_default_account(LC);
if(_addressLabel.text && account && linphone_account_is_phone_number(account, _addressLabel.text.UTF8String)) {
normAddr = linphone_account_normalize_phone_number(account,
_addressLabel.text.UTF8String);
}
LinphoneAddress *addr = linphone_core_interpret_url(LC, normAddr);
......@@ -66,12 +66,12 @@
self.linphoneImage.hidden = [LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"] ||
!((model && linphone_presence_model_get_basic_status(model) == LinphonePresenceBasicStatusOpen) ||
(cfg && !linphone_proxy_config_is_phone_number(cfg,
(account && !linphone_account_is_phone_number(account,
_addressLabel.text.UTF8String) &&
[FastAddressBook isSipURIValid:_addressLabel.text]));
ContactDetailsView *contactDetailsView = VIEW(ContactDetailsView);
self.inviteButton.hidden = !ENABLE_SMS_INVITE || [[contactDetailsView.contact sipAddresses] count] > 0 || !self.linphoneImage.hidden;
[self shouldHideEncryptedChatView:cfg && linphone_proxy_config_get_conference_factory_uri(cfg) && model && linphone_presence_model_has_capability(model, LinphoneFriendCapabilityLimeX3dh)];
[self shouldHideEncryptedChatView:account && linphone_account_params_get_conference_factory_uri(linphone_account_get_params(account)) && model && linphone_presence_model_has_capability(model, LinphoneFriendCapabilityLimeX3dh)];
}
if (addr) {
......@@ -97,10 +97,10 @@
}
char *normAddr = (char *)_addressLabel.text.UTF8String;
LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC);
if (cfg && linphone_proxy_config_is_phone_number(cfg,
LinphoneAccount *account = linphone_core_get_default_account(LC);
if (account && linphone_account_is_phone_number(account,
_addressLabel.text.UTF8String)) {
normAddr = linphone_proxy_config_normalize_phone_number(cfg,
normAddr = linphone_account_normalize_phone_number(account,
_addressLabel.text.UTF8String);
}
LinphoneAddress *addr = linphone_core_interpret_url(LC, normAddr);
......@@ -109,7 +109,7 @@
Contact *contact = [FastAddressBook getContactWithAddress:(addr)];
if (contact) {
self.linphoneImage.hidden =[LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"] || ! ((contact.friend && linphone_presence_model_get_basic_status(linphone_friend_get_presence_model_for_uri_or_tel(contact.friend, _addressLabel.text.UTF8String)) == LinphonePresenceBasicStatusOpen) || (cfg && !linphone_proxy_config_is_phone_number(cfg, _addressLabel.text.UTF8String) && [FastAddressBook isSipURIValid:_addressLabel.text]));
self.linphoneImage.hidden =[LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"] || ! ((contact.friend && linphone_presence_model_get_basic_status(linphone_friend_get_presence_model_for_uri_or_tel(contact.friend, _addressLabel.text.UTF8String)) == LinphonePresenceBasicStatusOpen) || (account && !linphone_account_is_phone_number(account, _addressLabel.text.UTF8String) && [FastAddressBook isSipURIValid:_addressLabel.text]));
}
if (addr) {
......
......@@ -516,7 +516,7 @@
LOGD(@"dumpContactsDisplayNamesToUserDefaults");
NSUserDefaults *defaults = [[NSUserDefaults alloc] initWithSuiteName:kLinphoneMsgNotificationAppGroupId];
__block NSDictionary *oldDisplayNames = [defaults dictionaryForKey:@"addressBook"];
LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC);
LinphoneAccount *account = linphone_core_get_default_account(LC);
__block NSMutableDictionary *displayNames = [[NSMutableDictionary dictionary] init];
[_addressBookMap enumerateKeysAndObjectsUsingBlock:^(NSString *name, Contact *contact, BOOL *stop) {
......@@ -524,7 +524,7 @@
NSString *key = name;
LinphoneAddress *addr = linphone_address_new(name.UTF8String);
if (addr && linphone_proxy_config_is_phone_number(cfg, linphone_address_get_username(addr))) {
if (addr && linphone_account_is_phone_number(account, linphone_address_get_username(addr))) {
if (oldDisplayNames[name] != nil && [FastAddressBook isSipURI:oldDisplayNames[name]]) {
NSString *addrForTel = [NSString stringWithString:oldDisplayNames[name]];
/* we keep the link between tel number and sip addr to have the information quickly.
......@@ -583,7 +583,7 @@
if ([FastAddressBook isSipURI:uri]) {
LinphoneAddress *addr = linphone_address_new(uri.UTF8String);
if (linphone_proxy_config_is_phone_number(linphone_core_get_default_proxy_config(LC), linphone_address_get_username(addr))) {
if (linphone_account_is_phone_number(linphone_core_get_default_account(LC), linphone_address_get_username(addr))) {
telAddr = uri;
}
linphone_address_unref(addr);
......
......@@ -457,13 +457,13 @@
if (!value || [value isEqualToString:@""])
return NULL;
LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC);
LinphoneAccount *account = linphone_core_get_default_account(LC);
const char *normvalue;
normvalue = linphone_proxy_config_is_phone_number(cfg, value.UTF8String)
? linphone_proxy_config_normalize_phone_number(cfg, value.UTF8String)
normvalue = linphone_account_is_phone_number(account, value.UTF8String)
? linphone_account_normalize_phone_number(account, value.UTF8String)
: value.UTF8String;
LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(cfg, normvalue);
LinphoneAddress *addr = linphone_account_normalize_sip_uri(account, normvalue);
// first try to find a friend with the given address
Contact *c = [FastAddressBook getContactWithAddress:addr];
......@@ -484,10 +484,10 @@
// since user wants to escape plus, we assume it expects to have phone
// numbers by default
if (addr && cfg) {
const char *username = linphone_proxy_config_get_dial_escape_plus(cfg) ? normvalue : value.UTF8String;
if (linphone_proxy_config_is_phone_number(cfg, username))
linphone_address_set_username(addr, linphone_proxy_config_normalize_phone_number(cfg, username));
if (addr && account) {
const char *username = linphone_account_params_get_dial_escape_plus_enabled(linphone_account_get_params(account)) ? normvalue : value.UTF8String;
if (linphone_account_is_phone_number(account, username))
linphone_address_set_username(addr, linphone_account_normalize_phone_number(account, username));
}
return addr;
}
......
......@@ -5,7 +5,7 @@ source "https://github.com/CocoaPods/Specs.git"
def all_pods
if ENV['PODFILE_PATH'].nil?
pod 'linphone-sdk', '4.5.0'
pod 'linphone-sdk', '~> 5.0.0-alpha'
else
pod 'linphone-sdk', :path => ENV['PODFILE_PATH'] # local sdk
end
......
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