From cf1e7cae93f864ae3f17e12b084d953717cb5427 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 27 Feb 2014 11:54:28 +0100 Subject: [PATCH 05/11] 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 1eec81f..8448af7 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", ×tamp); 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", ×tamp); + g_variant_unref (header); return timestamp; } -- 1.8.5.3