diff --git a/linphone/coreapi/linphonecore.c b/linphone/coreapi/linphonecore.c index 239fdd19f7c7fae337851463aa7633ffd13bf40d..c5a07d1b4ddb3c24381235d04670652ebf045688 100644 --- a/linphone/coreapi/linphonecore.c +++ b/linphone/coreapi/linphonecore.c @@ -1040,7 +1040,9 @@ static void assign_buddy_info(LinphoneCore *lc, BuddyInfo *info){ LinphoneFriend *lf=linphone_core_get_friend_by_uri(lc,info->sip_uri); if (lf!=NULL){ lf->info=info; - ms_message("%s has a BuddyInfo assigned.",info->sip_uri); + ms_message("%s has a BuddyInfo assigned with image %p",info->sip_uri, info->image_data); + if (lc->vtable.buddy_info_updated) + lc->vtable.buddy_info_updated(lc,lf); }else{ ms_warning("Could not any friend with uri %s",info->sip_uri); } @@ -1076,16 +1078,14 @@ static void linphone_core_grab_buddy_infos(LinphoneCore *lc, LinphoneProxyConfig if (lf->info==NULL){ char *url=linphone_friend_get_url(lf); if (linphone_core_lookup_known_proxy(lc,url)==cfg){ - char *name=linphone_friend_get_name(lf); - if (name!=NULL && strlen(name)>0){ + if (lf->url->url->username!=NULL && lf->url->url->username[0]!='0'){ BuddyLookupRequest *req; req=sip_setup_context_create_buddy_lookup_request(ctx); - buddy_lookup_request_set_key(req,name); + buddy_lookup_request_set_key(req,lf->url->url->username); buddy_lookup_request_set_max_results(req,1); sip_setup_context_buddy_lookup_submit(ctx,req); lc->bl_reqs=ms_list_append(lc->bl_reqs,req); } - ms_free(name); } ms_free(url); } diff --git a/linphone/coreapi/linphonecore.h b/linphone/coreapi/linphonecore.h index 5485cbd262178ee81acef3cbea770e693f8f6237..9a14f7d76bc738f041f9de37ca39f57aabdc54aa 100644 --- a/linphone/coreapi/linphonecore.h +++ b/linphone/coreapi/linphonecore.h @@ -403,6 +403,7 @@ typedef void (*TextMessageReceived)(struct _LinphoneCore *lc, LinphoneChatRoom * typedef void (*GeneralStateChange)(struct _LinphoneCore *lc, LinphoneGeneralState *gstate); typedef void (*DtmfReceived)(struct _LinphoneCore* lc, int dtmf); typedef void (*ReferReceived)(struct _LinphoneCore *lc, const char *refer_to); +typedef void (*BuddyInfoUpdated)(struct _LinphoneCore *lc, LinphoneFriend *lf); typedef struct _LinphoneVTable { @@ -426,6 +427,7 @@ typedef struct _LinphoneVTable GeneralStateChange general_state; DtmfReceived dtmf_received; ReferReceived refer_received; + BuddyInfoUpdated buddy_info_updated; } LinphoneCoreVTable; typedef struct _LCCallbackObj diff --git a/linphone/gtk-glade/friendlist.c b/linphone/gtk-glade/friendlist.c index 59f05e58b535eae1a2e24cff9b3ccac364c57c72..ea2ada25865e497a8882aa4d8179f0cd5136dd87 100644 --- a/linphone/gtk-glade/friendlist.c +++ b/linphone/gtk-glade/friendlist.c @@ -571,3 +571,9 @@ gboolean linphone_gtk_contact_list_button_pressed(GtkWidget *widget, GdkEventBut return FALSE; } +void linphone_gtk_buddy_info_updated(LinphoneCore *lc, LinphoneFriend *lf){ + /*refresh the entire list*/ + linphone_gtk_show_friends(); +} + + diff --git a/linphone/gtk-glade/linphone.h b/linphone/gtk-glade/linphone.h index d1ba99459ad48a77aa515f15b8c31cf15daac685..5d497b417860ea4aa993a48b3a6d018480cb8c9c 100644 --- a/linphone/gtk-glade/linphone.h +++ b/linphone/gtk-glade/linphone.h @@ -66,6 +66,7 @@ void linphone_gtk_log_show(void); void linphone_gtk_log_push(OrtpLogLevel lev, const char *fmt, va_list args); void linphone_gtk_destroy_log_window(void); gboolean linphone_gtk_check_logs(); +void linphone_gtk_buddy_info_updated(LinphoneCore *lc, LinphoneFriend *lf); const gchar *linphone_gtk_get_ui_config(const char *key, const char *def); int linphone_gtk_get_ui_config_int(const char *key, int def); void linphone_gtk_set_ui_config_int(const char *key , int val); diff --git a/linphone/gtk-glade/main.c b/linphone/gtk-glade/main.c index 8c115e09d688a0b7df2b9b66551f5a15d3e61be6..20c42531141b6bc3d0e04a7ca31bb85665088721 100644 --- a/linphone/gtk-glade/main.c +++ b/linphone/gtk-glade/main.c @@ -70,7 +70,8 @@ static LinphoneCoreVTable vtable={ .call_log_updated=linphone_gtk_call_log_updated, .text_received=linphone_gtk_text_received, .general_state=linphone_gtk_general_state, - .refer_received=linphone_gtk_refer_received + .refer_received=linphone_gtk_refer_received, + .buddy_info_updated=linphone_gtk_buddy_info_updated }; static gboolean verbose=0;