telepathy-logger: use tp_message_get_pending_message_id()

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Mon Mar 3 02:57:44 PST 2014


Module: telepathy-logger
Branch: master
Commit: 8cdd3cf4711ea6655f65676c93b252ae641d4581
URL:    http://cgit.freedesktop.org/telepathy/telepathy-logger/commit/?id=8cdd3cf4711ea6655f65676c93b252ae641d4581

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Mon Mar  3 11:57:23 2014 +0100

use tp_message_get_pending_message_id()

---

 telepathy-logger/text-channel.c |   21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/telepathy-logger/text-channel.c b/telepathy-logger/text-channel.c
index 7402eb3..8712cd5 100644
--- a/telepathy-logger/text-channel.c
+++ b/telepathy-logger/text-channel.c
@@ -112,15 +112,6 @@ on_channel_invalidated_cb (TpProxy *proxy,
   g_object_unref (observer);
 }
 
-
-static guint
-get_message_pending_id (TpMessage *m)
-{
-  return tp_asv_get_uint32 (tp_message_peek (TP_MESSAGE (m), 0),
-      "pending-message-id", NULL);
-}
-
-
 static gint64
 get_original_message_timestamp (TpMessage *message)
 {
@@ -281,7 +272,7 @@ tpl_text_channel_store_message (TplTextChannel *self,
       TplLogStore *cache = _tpl_log_store_sqlite_dup ();
       _tpl_log_store_sqlite_add_pending_message (cache,
           TP_CHANNEL (self),
-          get_message_pending_id (message),
+          tp_message_get_pending_message_id (message, NULL),
           timestamp,
           &error);
 
@@ -362,7 +353,8 @@ on_pending_message_removed_cb (TpTextChannel *self,
   GError *error = NULL;
 
   ids = g_list_prepend (ids,
-      GUINT_TO_POINTER (get_message_pending_id (TP_MESSAGE (message))));
+      GUINT_TO_POINTER (tp_message_get_pending_message_id (
+          TP_MESSAGE (message), NULL)));
 
   cache = _tpl_log_store_sqlite_dup ();
   _tpl_log_store_sqlite_remove_pending_messages (cache, TP_CHANNEL (self),
@@ -385,8 +377,8 @@ pending_message_compare_id (TpSignalledMessage *m1,
 {
   guint id1, id2;
 
-  id1 = get_message_pending_id (TP_MESSAGE (m1));
-  id2 = get_message_pending_id (TP_MESSAGE (m2));
+  id1 = tp_message_get_pending_message_id (TP_MESSAGE (m1), NULL);
+  id2 = tp_message_get_pending_message_id (TP_MESSAGE (m2), NULL);
 
   if (id1 > id2)
     return 1;
@@ -472,7 +464,8 @@ store_pending_messages (TplTextChannel *self)
         }
 
       pending = pending_it->data;
-      pending_id = get_message_pending_id (TP_MESSAGE (pending));
+      pending_id = tp_message_get_pending_message_id (TP_MESSAGE (pending),
+          NULL);
       pending_ts = get_message_timestamp (TP_MESSAGE (pending));
 
       if (cached->id == pending_id)



More information about the telepathy-commits mailing list