summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-03-18 15:20:35 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-03-18 15:20:35 +0100
commit15e9cc52d75387bc5e452ad6253a3f4b58a8ce2e (patch)
tree83d69c8d7d02a59d6c16ad003eb4380dd28eca0f
parent74c754a6e8f83b5715ca229266ccdcb32cc0c498 (diff)
tp_message_peek() has been removedtelepathy-rakia-0.99.8
-rw-r--r--rakia/text-channel.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/rakia/text-channel.c b/rakia/text-channel.c
index 82079bd..1677211 100644
--- a/rakia/text-channel.c
+++ b/rakia/text-channel.c
@@ -382,7 +382,7 @@ rakia_text_channel_send_message (GObject *object,
RakiaTextPendingMessage *msg = NULL;
nua_handle_t *msg_nh = NULL;
GError *error = NULL;
- const GHashTable *part;
+ GVariant *part;
guint n_parts;
const gchar *content_type;
const gchar *text;
@@ -397,14 +397,15 @@ rakia_text_channel_send_message (GObject *object,
goto fail; \
} G_STMT_END
- part = tp_message_peek (message, 0);
+ part = tp_message_dup_part (message, 0);
- if (tp_asv_lookup (part, "message-type") != NULL)
+ if (tp_vardict_has_key (part, "message-type"))
{
- if (tp_asv_get_uint32 (part, "message-type", NULL) !=
+ if (tp_vardict_get_uint32 (part, "message-type", NULL) !=
TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL)
INVALID_ARGUMENT ("invalid message type");
}
+ g_variant_unref (part);
n_parts = tp_message_count_parts (message);
@@ -412,9 +413,9 @@ rakia_text_channel_send_message (GObject *object,
INVALID_ARGUMENT ("message must contain exactly 1 part, not %u",
(n_parts - 1));
- part = tp_message_peek (message, 1);
- content_type = tp_asv_get_string (part, "content-type");
- text = tp_asv_get_string (part, "content");
+ part = tp_message_dup_part (message, 1);
+ content_type = tp_vardict_get_string (part, "content-type");
+ text = tp_vardict_get_string (part, "content");
if (content_type == NULL || tp_strdiff (content_type, "text/plain"))
INVALID_ARGUMENT ("message must be text/plain");
@@ -449,9 +450,11 @@ rakia_text_channel_send_message (GObject *object,
g_queue_push_tail (priv->sending_messages, msg);
DEBUG ("message queued for delivery");
+ g_variant_unref (part);
return;
fail:
+ g_variant_unref (part);
g_assert (error != NULL);
tp_message_mixin_sent (object, message, 0, NULL, error);
g_error_free (error);