[empathy/gnome-2-34] EmpathyChat::new-message: tell if the message is a pending one or not



commit d0af8490d944fc16124768917be17059010e9b1a
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Nov 30 14:56:39 2010 +0100

    EmpathyChat::new-message: tell if the message is a pending one or not

 libempathy-gtk/empathy-chat.c |   16 ++++++++++------
 src/empathy-chat-window.c     |    1 +
 2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 9643dfb..550f2a7 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -42,6 +42,7 @@
 #include <libempathy/empathy-gsettings.h>
 #include <libempathy/empathy-utils.h>
 #include <libempathy/empathy-dispatcher.h>
+#include <libempathy/empathy-marshal.h>
 
 #include "empathy-chat.h"
 #include "empathy-spell.h"
@@ -57,6 +58,7 @@
 #define DEBUG_FLAG EMPATHY_DEBUG_CHAT
 #include <libempathy/empathy-debug.h>
 
+
 #define CHAT_DIR_CREATE_MODE  (S_IRUSR | S_IWUSR | S_IXUSR)
 #define CHAT_FILE_CREATE_MODE (S_IRUSR | S_IWUSR)
 #define IS_ENTER(v) (v == GDK_KEY_Return || v == GDK_KEY_ISO_Enter || v == GDK_KEY_KP_Enter)
@@ -1108,7 +1110,9 @@ chat_state_changed_cb (EmpathyTpChat      *tp_chat,
 }
 
 static void
-chat_message_received (EmpathyChat *chat, EmpathyMessage *message)
+chat_message_received (EmpathyChat *chat,
+	EmpathyMessage *message,
+	gboolean pending)
 {
 	EmpathyChatPriv *priv = GET_PRIV (chat);
 	EmpathyContact  *sender;
@@ -1127,7 +1131,7 @@ chat_message_received (EmpathyChat *chat, EmpathyMessage *message)
 			       chat);
 
 	priv->unread_messages++;
-	g_signal_emit (chat, signals[NEW_MESSAGE], 0, message);
+	g_signal_emit (chat, signals[NEW_MESSAGE], 0, message, pending);
 }
 
 static void
@@ -1135,7 +1139,7 @@ chat_message_received_cb (EmpathyTpChat  *tp_chat,
 			  EmpathyMessage *message,
 			  EmpathyChat    *chat)
 {
-	chat_message_received (chat, message);
+	chat_message_received (chat, message, FALSE);
 }
 
 static void
@@ -1936,7 +1940,7 @@ show_pending_messages (EmpathyChat *chat) {
 
 	for (l = messages; l != NULL ; l = g_list_next (l)) {
 		EmpathyMessage *message = EMPATHY_MESSAGE (l->data);
-		chat_message_received (chat, message);
+		chat_message_received (chat, message, TRUE);
 	}
 }
 
@@ -2752,9 +2756,9 @@ empathy_chat_class_init (EmpathyChatClass *klass)
 			      G_SIGNAL_RUN_LAST,
 			      0,
 			      NULL, NULL,
-			      g_cclosure_marshal_VOID__OBJECT,
+			      _empathy_marshal_VOID__OBJECT_BOOLEAN,
 			      G_TYPE_NONE,
-			      1, EMPATHY_TYPE_MESSAGE);
+			      2, EMPATHY_TYPE_MESSAGE, G_TYPE_BOOLEAN);
 
 	g_type_class_add_private (object_class, sizeof (EmpathyChatPriv));
 }
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 4b181d3..79d27f9 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1351,6 +1351,7 @@ chat_window_set_highlight_room_tab_label (EmpathyChat *chat)
 static void
 chat_window_new_message_cb (EmpathyChat       *chat,
 			    EmpathyMessage    *message,
+			    gboolean pending,
 			    EmpathyChatWindow *window)
 {
 	EmpathyChatWindowPriv *priv;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]