]> sjero.net Git - linphone/blobdiff - coreapi/friend.c
update ms2
[linphone] / coreapi / friend.c
index 2afcc4217798931d18fb37f352c42351c73225b7..c6dee2440a8d28019c003893123cc2dfde218b0a 100644 (file)
@@ -186,6 +186,7 @@ void linphone_core_interpret_friend_uri(LinphoneCore *lc, const char *uri, char
                        /*try adding domain part from default current proxy*/
                        LinphoneAddress * id=linphone_address_new(linphone_core_get_identity(lc));
                        if (id!=NULL){
+                               linphone_address_set_display_name(id,NULL);
                                linphone_address_set_username(id,uri);
                                *result=linphone_address_as_string(id);
                                linphone_address_destroy(id);
@@ -395,8 +396,8 @@ void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *lf)
 void linphone_core_remove_friend(LinphoneCore *lc, LinphoneFriend* fl){
        MSList *el=ms_list_find(lc->friends,(void *)fl);
        if (el!=NULL){
-               lc->friends=ms_list_remove_link(lc->friends,el);
                linphone_friend_destroy((LinphoneFriend*)el->data);
+               lc->friends=ms_list_remove_link(lc->friends,el);
                linphone_core_write_friends_config(lc);
        }
 }
@@ -443,6 +444,10 @@ LinphoneFriend *linphone_core_get_friend_by_address(const LinphoneCore *lc, cons
        }
        username=linphone_address_get_username(puri);
        domain=linphone_address_get_domain(puri);
+       if (domain==NULL) {
+               linphone_address_destroy(puri);
+               return NULL;
+       }
        for(elem=lc->friends;elem!=NULL;elem=ms_list_next(elem)){
                lf=(LinphoneFriend*)elem->data;
                const char *it_username=linphone_address_get_username(lf->uri);