summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-03-03 10:57:23 (GMT)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-03-03 10:57:23 (GMT)
commit8cdd3cf4711ea6655f65676c93b252ae641d4581 (patch)
tree575a317b03c1f71415e03d9a586105129a5e3eaa
parent734af806917d67dada9fc591da1673edfe1a8cdd (diff)
downloadtelepathy-logger-8cdd3cf4711ea6655f65676c93b252ae641d4581.tar.gz
use tp_message_get_pending_message_id()
-rw-r--r--telepathy-logger/text-channel.c21
1 files 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)