fix crash and bug around presence list subscription

This commit is contained in:
Simon Morlat 2016-09-14 16:29:31 +02:00
parent 09e861e19e
commit 3322463148
2 changed files with 9 additions and 5 deletions

View file

@ -976,11 +976,12 @@ void linphone_friend_list_export_friends_as_vcard4_file(LinphoneFriendList *list
void linphone_friend_list_enable_subscriptions(LinphoneFriendList *list, bool_t enabled) {
if (list->enable_subscriptions != enabled) {
list->enable_subscriptions = enabled;
if (enabled) {
linphone_friend_list_update_subscriptions(list, NULL, TRUE);
} else {
linphone_friend_list_close_subscriptions(list);
}
list->enable_subscriptions = enabled;
}
}

View file

@ -633,12 +633,15 @@ char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, c
LinphoneProxyConfig *tmpproxy = proxy ? proxy : linphone_proxy_config_new();
char* result = NULL;
if (linphone_proxy_config_is_phone_number(tmpproxy, username)){
LinphoneDialPlan dialplan = *linphone_dial_plan_by_ccc(tmpproxy->dial_prefix); //copy dial plan;
char * flatten=flatten_number(username);
LinphoneDialPlan dialplan = *linphone_dial_plan_by_ccc(tmpproxy->dial_prefix); //copy dial plan
ms_debug("Flattened number is '%s' for '%s'",flatten, username);
if (strcmp(tmpproxy->dial_prefix,dialplan.ccc)!=0){
//probably generic dialplan, preserving proxy dial prefix
strcpy(dialplan.ccc,tmpproxy->dial_prefix);
if (tmpproxy->dial_prefix){
if (strcmp(tmpproxy->dial_prefix,dialplan.ccc) != 0){
//probably generic dialplan, preserving proxy dial prefix
strcpy(dialplan.ccc,tmpproxy->dial_prefix);
}
}
/*if proxy has a dial prefix, modify phonenumber accordingly*/
if (tmpproxy->dial_prefix!=NULL && tmpproxy->dial_prefix[0]!='\0'){