[next] telepathy-glib: room-list: use tp_account_channel_request_new_vardict()
Guillaume Desmottes
gdesmott at kemper.freedesktop.org
Thu Feb 20 01:33:14 PST 2014
Module: telepathy-glib
Branch: next
Commit: 9ece7976886a666d31a6a55b04b7bd1055029f9b
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=9ece7976886a666d31a6a55b04b7bd1055029f9b
Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date: Mon Feb 17 16:52:10 2014 +0100
room-list: use tp_account_channel_request_new_vardict()
---
telepathy-glib/room-list.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/telepathy-glib/room-list.c b/telepathy-glib/room-list.c
index a7bb44e..4f37f07 100644
--- a/telepathy-glib/room-list.c
+++ b/telepathy-glib/room-list.c
@@ -491,28 +491,25 @@ create_channel_cb (GObject *source_object,
static void
open_new_channel (TpRoomList *self)
{
- GHashTable *request;
+ GVariantDict dict;
TpAccountChannelRequest *channel_request;
DEBUG ("Requesting new RoomList channel");
- request = tp_asv_new (
- TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
- TP_IFACE_CHANNEL_TYPE_ROOM_LIST1,
- NULL);
+ g_variant_dict_init (&dict, NULL);
+ g_variant_dict_insert (&dict,
+ TP_PROP_CHANNEL_CHANNEL_TYPE, "s", TP_IFACE_CHANNEL_TYPE_ROOM_LIST1);
if (self->priv->server != NULL)
- tp_asv_set_string (request, TP_PROP_CHANNEL_TYPE_ROOM_LIST1_SERVER,
- self->priv->server);
+ g_variant_dict_insert (&dict,
+ TP_PROP_CHANNEL_TYPE_ROOM_LIST1_SERVER, "s", self->priv->server);
- channel_request = tp_account_channel_request_new (self->priv->account,
- request, TP_USER_ACTION_TIME_NOT_USER_ACTION);
+ channel_request = tp_account_channel_request_new_vardict (self->priv->account,
+ g_variant_dict_end (&dict), TP_USER_ACTION_TIME_NOT_USER_ACTION);
tp_account_channel_request_create_and_handle_channel_async (channel_request,
NULL, create_channel_cb, G_OBJECT (self));
g_object_unref (channel_request);
-
- g_hash_table_unref (request);
}
static void
More information about the telepathy-commits
mailing list