aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-04-02 17:42:25 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-04-02 17:42:25 +0800
commit83e3f12e71422ebc42c523b9625b12eda77cca7c (patch)
tree9ae08e954926971eedaceff22ede180ea768b909
parentbd2e3b3dd564359072f50422dbadc01794d6203f (diff)
downloadgsoc2013-empathy-83e3f12e71422ebc42c523b9625b12eda77cca7c.tar
gsoc2013-empathy-83e3f12e71422ebc42c523b9625b12eda77cca7c.tar.gz
gsoc2013-empathy-83e3f12e71422ebc42c523b9625b12eda77cca7c.tar.bz2
gsoc2013-empathy-83e3f12e71422ebc42c523b9625b12eda77cca7c.tar.lz
gsoc2013-empathy-83e3f12e71422ebc42c523b9625b12eda77cca7c.tar.xz
gsoc2013-empathy-83e3f12e71422ebc42c523b9625b12eda77cca7c.tar.zst
gsoc2013-empathy-83e3f12e71422ebc42c523b9625b12eda77cca7c.zip
Do not ack pending messages until they are displayed
svn path=/trunk/; revision=857
-rw-r--r--libempathy/empathy-tp-chat.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 4c7702cd1..c3f456faf 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -355,7 +355,7 @@ tp_chat_received_cb (TpChannel *channel,
-1,
message_ids,
tp_chat_async_cb,
- "acknowledging pending messages",
+ "acknowledging received message",
NULL,
chat);
g_array_free (message_ids, TRUE);
@@ -439,6 +439,7 @@ tp_chat_list_pending_messages_cb (TpChannel *channel,
{
EmpathyTpChatPriv *priv = GET_PRIV (chat);
guint i;
+ GArray *message_ids = NULL;
priv->had_pending_messages = TRUE;
@@ -448,6 +449,11 @@ tp_chat_list_pending_messages_cb (TpChannel *channel,
return;
}
+ if (priv->acknowledge) {
+ message_ids = g_array_sized_new (FALSE, FALSE, sizeof (guint),
+ messages_list->len);
+ }
+
for (i = 0; i < messages_list->len; i++) {
EmpathyMessage *message;
GValueArray *message_struct;
@@ -469,6 +475,10 @@ tp_chat_list_pending_messages_cb (TpChannel *channel,
empathy_debug (DEBUG_DOMAIN, "Message pending: %s", message_body);
+ if (message_ids) {
+ g_array_append_val (message_ids, message_id);
+ }
+
message = tp_chat_build_message (EMPATHY_TP_CHAT (chat),
message_type,
timestamp,
@@ -478,6 +488,17 @@ tp_chat_list_pending_messages_cb (TpChannel *channel,
tp_chat_emit_or_queue_message (EMPATHY_TP_CHAT (chat), message);
g_object_unref (message);
}
+
+ if (message_ids) {
+ tp_cli_channel_type_text_call_acknowledge_pending_messages (priv->channel,
+ -1,
+ message_ids,
+ tp_chat_async_cb,
+ "acknowledging pending messages",
+ NULL,
+ chat);
+ g_array_free (message_ids, TRUE);
+ }
}
static void