[empathy] chat: don't display pending messages before messages from logs



commit cce0608573b9a8f675cd948622322f4f1ef2e947
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Dec 8 14:56:38 2009 +0000

    chat: don't display pending messages before messages from logs
    
    empathy_chat_set_tp_chat has a comment saying that show_pending_messages is a
    no-op when calling during object construction. This now is now actually true
    as we added a boolean saying if we can display pending messages or not.
    
    This is to avoid displaying pending messages *before* the messages fetched
    from logs (#603980).

 libempathy-gtk/empathy-chat.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index e627a5e..dec4757 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -95,6 +95,9 @@ typedef struct {
 	GtkWidget         *info_bar_vbox;
 
 	guint              unread_messages;
+	/* TRUE if the pending messages can be displayed. This is to avoid to show
+	 * pending messages *before* messages from logs. (#603980) */
+	gboolean           can_show_pending;
 } EmpathyChatPriv;
 
 typedef struct {
@@ -2014,6 +2017,9 @@ show_pending_messages (EmpathyChat *chat) {
 	if (chat->view == NULL || priv->tp_chat == NULL)
 		return;
 
+	if (!priv->can_show_pending)
+		return;
+
 	messages = empathy_tp_chat_get_pending_messages (priv->tp_chat);
 
 	for (l = messages; l != NULL ; l = g_list_next (l)) {
@@ -2242,6 +2248,7 @@ chat_constructed (GObject *object)
 
 	if (priv->handle_type != TP_HANDLE_TYPE_ROOM)
 		chat_add_logs (chat);
+	priv->can_show_pending = TRUE;
 	show_pending_messages (chat);
 }
 



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