summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-02-24 14:05:15 (GMT)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-02-26 09:32:36 (GMT)
commitdba59427329cbf16ea0c976057045d7d1b1efd88 (patch)
tree02ab87cfb40e423779dd5793e7bbe30f07966178
parent4bf3c0df71c73abfe6a8d4ad3b55fd7baf592bb1 (diff)
downloadempathy-dba59427329cbf16ea0c976057045d7d1b1efd88.tar.gz
empathy-dba59427329cbf16ea0c976057045d7d1b1efd88.tar.xz
request-util: use TpAccountChannelRequest higher level API
https://bugzilla.gnome.org/show_bug.cgi?id=725070
-rw-r--r--libempathy/empathy-request-util.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/libempathy/empathy-request-util.c b/libempathy/empathy-request-util.c
index 280ff0f..fa55128 100644
--- a/libempathy/empathy-request-util.c
+++ b/libempathy/empathy-request-util.c
@@ -60,28 +60,21 @@ create_text_channel (TpAccount *account,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GHashTable *request;
TpAccountChannelRequest *req;
- request = tp_asv_new (
- TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
- TP_IFACE_CHANNEL_TYPE_TEXT,
- TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, target_handle_type,
- TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, target_id,
- NULL);
+ req = tp_account_channel_request_new_text (account, timestamp);
+ tp_account_channel_request_set_target_id (req, target_handle_type, target_id);
+ tp_account_channel_request_set_delegate_to_preferred_handler (req, TRUE);
if (sms_channel)
- tp_asv_set_boolean (request,
- TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL, TRUE);
-
- req = tp_account_channel_request_new (account, request, timestamp);
- tp_account_channel_request_set_delegate_to_preferred_handler (req, TRUE);
+ tp_account_channel_request_set_request_property (req,
+ TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL,
+ g_variant_new_boolean (TRUE));
tp_account_channel_request_ensure_channel_async (req,
EMPATHY_CHAT_TP_BUS_NAME, NULL,
callback ? callback : ensure_text_channel_cb, user_data);
- g_hash_table_unref (request);
g_object_unref (req);
}