[empathy] event-manager: look for existing messages when approving



commit e74a36868d7abe9c8559567cd4e6d82ce24469af
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Feb 15 10:23:21 2011 +0100

    event-manager: look for existing messages when approving
    
    We may have already received some as the EmpathyTpChat is created earlier now.

 src/empathy-event-manager.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index baa06dc..c6f5860 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -929,6 +929,7 @@ approve_channels (TpSimpleApprover *approver,
   if (TP_IS_TEXT_CHANNEL (channel))
     {
       EmpathyTpChat *tp_chat = EMPATHY_TP_CHAT (channel);
+      GList *messages, *l;
 
       approval->handler_instance = g_object_ref (tp_chat);
 
@@ -968,6 +969,14 @@ approve_channels (TpSimpleApprover *approver,
       /* 1-1 text channel, wait for the first message */
       approval->handler = g_signal_connect (tp_chat, "message-received-empathy",
         G_CALLBACK (event_manager_chat_message_received_cb), approval);
+
+      messages = (GList *) empathy_tp_chat_get_pending_messages (tp_chat);
+      for (l = messages; l != NULL; l = g_list_next (l))
+        {
+          EmpathyMessage *msg = l->data;
+
+          event_manager_chat_message_received_cb (tp_chat, msg, approval);
+        }
     }
   else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA)
     {



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