aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-02-24 22:05:15 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-02-26 17:32:36 +0800
commit7bc22f4ce28451115bbb92d760cb52316bdb6775 (patch)
tree33a4b9d93f9b58c65cb9dcca7a3131527a8e80fd
parentdba59427329cbf16ea0c976057045d7d1b1efd88 (diff)
downloadgsoc2013-empathy-7bc22f4ce28451115bbb92d760cb52316bdb6775.tar
gsoc2013-empathy-7bc22f4ce28451115bbb92d760cb52316bdb6775.tar.gz
gsoc2013-empathy-7bc22f4ce28451115bbb92d760cb52316bdb6775.tar.bz2
gsoc2013-empathy-7bc22f4ce28451115bbb92d760cb52316bdb6775.tar.lz
gsoc2013-empathy-7bc22f4ce28451115bbb92d760cb52316bdb6775.tar.xz
gsoc2013-empathy-7bc22f4ce28451115bbb92d760cb52316bdb6775.tar.zst
gsoc2013-empathy-7bc22f4ce28451115bbb92d760cb52316bdb6775.zip
tp-chat: use TpAccountChannelRequest higher level API
https://bugzilla.gnome.org/show_bug.cgi?id=725070
-rw-r--r--libempathy/empathy-tp-chat.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index caa3960b8..31a92719d 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -196,39 +196,38 @@ empathy_tp_chat_add (EmpathyTpChat *self,
else if (self->priv->can_upgrade_to_muc)
{
TpAccountChannelRequest *req;
- GHashTable *props;
- const char *object_path;
- GPtrArray channels = { (gpointer *) &object_path, 1 };
+ const gchar *channels[2] = { NULL, };
const char *invitees[2] = { NULL, };
TpAccount *account;
invitees[0] = empathy_contact_get_id (contact);
- object_path = tp_proxy_get_object_path (self);
-
- props = 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,
- TP_HANDLE_TYPE_NONE,
- TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_CHANNELS,
- TP_ARRAY_TYPE_OBJECT_PATH_LIST, &channels,
- TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS,
- G_TYPE_STRV, invitees,
- /* FIXME: InvitationMessage ? */
- NULL);
+ channels[0] = tp_proxy_get_object_path (self);
account = empathy_tp_chat_get_account (self);
- req = tp_account_channel_request_new (account, props,
+ req = tp_account_channel_request_new_text (account,
TP_USER_ACTION_TIME_NOT_USER_ACTION);
+ tp_account_channel_request_set_request_property (req,
+ TP_PROP_CHANNEL_TARGET_HANDLE_TYPE,
+ g_variant_new_uint32 (TP_HANDLE_TYPE_NONE));
+
+ tp_account_channel_request_set_request_property (req,
+ TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_CHANNELS,
+ g_variant_new_objv (channels, -1));
+
+ tp_account_channel_request_set_request_property (req,
+ TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS,
+ g_variant_new_strv (invitees, -1));
+
+ /* FIXME: InvitationMessage ? */
+
/* Although this is a MUC, it's anonymous, so CreateChannel is
* valid. */
tp_account_channel_request_create_and_observe_channel_async (req,
EMPATHY_CHAT_TP_BUS_NAME, NULL, create_conference_cb, NULL);
g_object_unref (req);
- g_hash_table_unref (props);
}
else
{