aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-06-21 19:55:54 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-06-21 19:55:54 +0800
commit3db97d5b3ec2854c522b9d2b378f2a65620a783d (patch)
treee4c543a694c9930a1338bceaef3fcb5eec7723ec /libempathy-gtk
parentb6984f0d3afa9241ede62496d6a65e0d86fd0f8b (diff)
parent005e206844be26a15012cc235927531bd3e38420 (diff)
downloadgsoc2013-empathy-3db97d5b3ec2854c522b9d2b378f2a65620a783d.tar
gsoc2013-empathy-3db97d5b3ec2854c522b9d2b378f2a65620a783d.tar.gz
gsoc2013-empathy-3db97d5b3ec2854c522b9d2b378f2a65620a783d.tar.bz2
gsoc2013-empathy-3db97d5b3ec2854c522b9d2b378f2a65620a783d.tar.lz
gsoc2013-empathy-3db97d5b3ec2854c522b9d2b378f2a65620a783d.tar.xz
gsoc2013-empathy-3db97d5b3ec2854c522b9d2b378f2a65620a783d.tar.zst
gsoc2013-empathy-3db97d5b3ec2854c522b9d2b378f2a65620a783d.zip
Merge branch 'unread-653090'
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-chat.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index bb33130e3..cd73c1f0d 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -121,6 +121,7 @@ struct _EmpathyChatPriv {
GtkWidget *search_bar;
guint unread_messages;
+ guint unread_messages_when_offline;
/* 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;
@@ -2688,6 +2689,8 @@ chat_invalidated_cb (EmpathyTpChat *tp_chat,
gtk_widget_set_sensitive (chat->input_text_view, FALSE);
chat_update_contacts_visibility (chat, FALSE);
+
+ priv->unread_messages_when_offline = priv->unread_messages;
}
static gboolean
@@ -4026,6 +4029,14 @@ empathy_chat_messages_read (EmpathyChat *self)
if (priv->tp_chat != NULL) {
empathy_tp_chat_acknowledge_all_messages (priv->tp_chat);
}
+
+ if (priv->unread_messages_when_offline > 0) {
+ /* We can't ack those as the connection has gone away so just consider
+ * them as read. */
+ priv->unread_messages -= priv->unread_messages_when_offline;
+ g_object_notify (G_OBJECT (self), "nb-unread-messages");
+ priv->unread_messages_when_offline = 0;
+ }
}
/* Return TRUE if on of the contacts in this chat is composing */