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).
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 {
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)) {
if (priv->handle_type != TP_HANDLE_TYPE_ROOM)
chat_add_logs (chat);
+ priv->can_show_pending = TRUE;
show_pending_messages (chat);
}