aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-08 22:56:38 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-08 23:02:34 +0800
commitcce0608573b9a8f675cd948622322f4f1ef2e947 (patch)
treeaf9e770303be9675baa459964849a6c9f4fe5977
parent9a2a6a34682af3eb6ff1741e45a0c1b5cd4d386f (diff)
downloadgsoc2013-empathy-cce0608573b9a8f675cd948622322f4f1ef2e947.tar
gsoc2013-empathy-cce0608573b9a8f675cd948622322f4f1ef2e947.tar.gz
gsoc2013-empathy-cce0608573b9a8f675cd948622322f4f1ef2e947.tar.bz2
gsoc2013-empathy-cce0608573b9a8f675cd948622322f4f1ef2e947.tar.lz
gsoc2013-empathy-cce0608573b9a8f675cd948622322f4f1ef2e947.tar.xz
gsoc2013-empathy-cce0608573b9a8f675cd948622322f4f1ef2e947.tar.zst
gsoc2013-empathy-cce0608573b9a8f675cd948622322f4f1ef2e947.zip
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).
-rw-r--r--libempathy-gtk/empathy-chat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index e627a5ef8..dec4757db 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);
}