[next] telepathy-glib: logger: use tp_message_dup_part()

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Thu Mar 6 04:20:08 PST 2014


Module: telepathy-glib
Branch: next
Commit: a089ddbda33d5d5e55219cd9beee64acee3a9899
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=a089ddbda33d5d5e55219cd9beee64acee3a9899

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Thu Feb 27 11:54:28 2014 +0100

logger: use tp_message_dup_part()

---

 telepathy-logger/text-channel.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/telepathy-logger/text-channel.c b/telepathy-logger/text-channel.c
index 8132b9a..33895fa 100644
--- a/telepathy-logger/text-channel.c
+++ b/telepathy-logger/text-channel.c
@@ -115,15 +115,17 @@ on_channel_invalidated_cb (TpProxy *proxy,
 static gint64
 get_original_message_timestamp (TpMessage *message)
 {
+  GVariant *header;
   gint64 timestamp;
 
-  timestamp = tp_asv_get_int64 (tp_message_peek (message, 0),
-      "original-message-sent", NULL);
+  header = tp_message_dup_part (message, 0);
+
+  g_variant_lookup (header, "original-message-sent", "x", &timestamp);
 
   if (timestamp == 0)
-    timestamp = tp_asv_get_int64 (tp_message_peek (message, 0),
-        "original-message-received", NULL);
+    g_variant_lookup (header, "original-message-received", "x", &timestamp);
 
+  g_variant_unref (header);
   return timestamp;
 }
 



More information about the telepathy-commits mailing list