[empathy] chat: display pending messages once constructed if the channel is a room (#623112)



commit 2cba9cbe1638c309e680778598ff66e319615b0a
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Jun 29 14:25:49 2010 +0200

    chat: display pending messages once constructed if the channel is a room (#623112)
    
    Now that we wait that the TpChat has retrieved pending messages before
    considering it as ready, the message-received signal is fired *before* we
    connect it in EmpathyChat and so it misses them.
    
    We fix that by looking for pending messages once the EmpathyChat has been
    constructed.

 libempathy-gtk/empathy-chat.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index d50bfe4..487d0c1 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -2673,8 +2673,15 @@ chat_constructed (GObject *object)
 	EmpathyChat *chat = EMPATHY_CHAT (object);
 	EmpathyChatPriv *priv = GET_PRIV (chat);
 
-	if (priv->handle_type != TP_HANDLE_TYPE_ROOM)
+	if (priv->handle_type != TP_HANDLE_TYPE_ROOM) {
+		/* First display logs from the logger and then display pending messages */
 		chat_add_logs (chat);
+	}
+	 else {
+		/* Just display pending messages for rooms */
+		priv->can_show_pending = TRUE;
+		show_pending_messages (chat);
+	}
 }
 
 static void



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