From fb049bcc5f5622b56112c947b5b571c6f0956671 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 30 Nov 2010 14:56:39 +0100 Subject: EmpathyChat::new-message: tell if the message is a pending one or not --- libempathy-gtk/empathy-chat.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index dc3bb8f69..04247986e 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "empathy-chat.h" #include "empathy-spell.h" @@ -58,6 +59,7 @@ #define DEBUG_FLAG EMPATHY_DEBUG_CHAT #include + #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) @@ -1111,7 +1113,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; @@ -1130,7 +1134,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 @@ -1138,7 +1142,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 @@ -2032,7 +2036,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); } } @@ -2832,9 +2836,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)); } -- cgit v1.2.3