From ba3a2f0549a9d6d5369d9379c9492df9f292754d Mon Sep 17 00:00:00 2001
From: Margaux Clerc <margaux.clerc@belledonne-communications.com>
Date: Wed, 20 Mar 2013 14:57:03 +0100
Subject: [PATCH] fix received messages in chat

---
 gtk/chat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gtk/chat.c b/gtk/chat.c
index 38efc10116..69c4e832f2 100644
--- a/gtk/chat.c
+++ b/gtk/chat.c
@@ -65,7 +65,7 @@ void linphone_gtk_quit_chatroom(LinphoneChatRoom *cr) {
 	
 	g_return_if_fail(w!=NULL);
 	gtk_notebook_remove_page(GTK_NOTEBOOK(nb),idx);
-	//linphone_gtk_create_chat_picture(FALSE);
+	linphone_gtk_create_chat_picture(FALSE);
 	g_object_set_data(G_OBJECT(friendlist),"chatview",NULL);
 	g_object_set_data(G_OBJECT(w),"from_message",NULL);	
 	g_object_set_data(G_OBJECT(w),"cr",NULL);
@@ -419,6 +419,7 @@ void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room,
 			send=FALSE;
 		}	
     } else {
+		send=FALSE;
         w=linphone_gtk_init_chatroom(room,linphone_chat_message_get_from(msg));
         g_object_set_data(G_OBJECT(friendlist),"chatview",(gpointer)w);
 		g_object_set_data(G_OBJECT(friendlist),"from",from);
@@ -438,6 +439,7 @@ void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room,
 	}
 	#endif
 	if(send){
+		linphone_chat_room_mark_as_read(room);
 		linphone_gtk_push_text(w,linphone_chat_message_get_from(msg),
 	                      FALSE,room,msg,FALSE);
 	} else {
@@ -445,8 +447,6 @@ void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room,
 		//linphone_gtk_friend_list_update_message(msg);
 	}
 		//linphone_gtk_update_chat_picture();
-		//TODO: update la zone de notification dans les contacts (problème : lors du refresh de la liste 
-		//connaitre tous les contacts qui ont des messages non lus ...
 	//gtk_window_present(GTK_WINDOW(w));
 	/*gtk_window_set_urgency_hint(GTK_WINDOW(w),TRUE);*/
 }
-- 
GitLab