From: Margaux Clerc Date: Thu, 17 Jan 2013 12:42:15 +0000 (+0100) Subject: fix chat picture update X-Git-Url: http://sjero.net/git/?p=linphone;a=commitdiff_plain;h=d55c0fbf6e48ebe1e14a4ad8772b6d9710f96584 fix chat picture update --- diff --git a/gtk/chat.c b/gtk/chat.c index b63144b1..257a5575 100644 --- a/gtk/chat.c +++ b/gtk/chat.c @@ -279,7 +279,7 @@ GtkWidget* linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const LinphoneAddres gtk_text_buffer_create_tag(gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)), "italic","style", PANGO_STYLE_ITALIC,NULL); gtk_text_buffer_create_tag(gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)), - "small","size",8*PANGO_SCALE,NULL); + "small","size",9*PANGO_SCALE,NULL); gtk_text_buffer_create_tag(gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)), "font_grey","foreground-gdk",&color,NULL); @@ -351,6 +351,7 @@ void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room, const } else { w=linphone_gtk_init_chatroom(room,from); g_object_set_data(G_OBJECT(friendlist),"chatview",(gpointer)w); + g_object_set_data(G_OBJECT(friendlist),"from",(gpointer)from); } const char *display=linphone_address_get_display_name(from); diff --git a/gtk/friendlist.c b/gtk/friendlist.c index 8bdd88ff..5ce869b4 100644 --- a/gtk/friendlist.c +++ b/gtk/friendlist.c @@ -188,28 +188,30 @@ void linphone_gtk_create_chat_picture(gboolean active){ } void linphone_gtk_update_chat_picture(){ - /*GtkTreeIter iter; + GtkTreeIter iter; GtkListStore *store=NULL; GtkWidget *w = linphone_gtk_get_main_window(); GtkWidget *friendlist=linphone_gtk_get_widget(w,"contact_list"); GtkTreeModel *model=gtk_tree_view_get_model(GTK_TREE_VIEW(friendlist)); GtkWidget *chat_view=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview"); LinphoneFriend *lf=NULL; - //LinphoneAddress *uri=(LinphoneAddress *)g_object_get_data(G_OBJECT(friendlist),"from"); + LinphoneAddress *uri=(LinphoneAddress *)g_object_get_data(G_OBJECT(friendlist),"from"); store=GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(friendlist))); if (gtk_tree_model_get_iter_first(model,&iter)) { do{ gtk_tree_model_get (model, &iter,FRIEND_ID , &lf, -1); if(chat_view!=NULL){ - //if(g_strcmp0(linphone_address_as_string(linphone_friend_get_address(lf)), - // linphone_address_as_string(uri))==0){ - gtk_list_store_set(store,&iter,FRIEND_CHAT,create_active_chat_picture(),-1); - //} else { - //gtk_list_store_set(store,&iter,FRIEND_CHAT,create_chat_picture(),-1); - //} + if(uri !=NULL) { + if(g_strcmp0(linphone_address_as_string(linphone_friend_get_address(lf)), + linphone_address_as_string(uri))==0){ + gtk_list_store_set(store,&iter,FRIEND_CHAT,create_active_chat_picture(),-1); + } else { + gtk_list_store_set(store,&iter,FRIEND_CHAT,create_chat_picture(),-1); + } + } } }while(gtk_tree_model_iter_next(model,&iter)); - }*/ + } } static gboolean grab_focus(GtkWidget *w){