From cd9b4f123ae2f6157db68c9c7015a493f388cd9a Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 26 Feb 2014 14:47:56 +0100 Subject: [PATCH 02/11] use tp_message_dup_part() instead of tp_message_peek() --- telepathy-glib/cm-message.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/telepathy-glib/cm-message.c b/telepathy-glib/cm-message.c index 9a28bb5..a66f3eb 100644 --- a/telepathy-glib/cm-message.c +++ b/telepathy-glib/cm-message.c @@ -301,8 +301,16 @@ _tp_cm_message_new_from_parts (TpBaseConnection *conn, TpHandle tp_cm_message_get_sender (TpMessage *self) { + GVariant *header; + TpHandle sender; + g_return_val_if_fail (TP_IS_CM_MESSAGE (self), 0); - return tp_asv_get_uint32 (tp_message_peek (self, 0), "message-sender", NULL); + + header = tp_message_dup_part (self, 0); + g_variant_lookup (header, "message-sender", "u", &sender); + g_variant_unref (header); + + return sender; } /** -- 1.8.5.3