aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-10 23:19:12 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-11 18:27:57 +0800
commit45e0ed0dd99ba9909721ef0838306764c9156655 (patch)
treeb8b8f68ae22e4e60589782b904e03213b198884b
parent8bf01d9bbd8a80cd1d898ecc26430304ac1482c9 (diff)
downloadgsoc2013-empathy-45e0ed0dd99ba9909721ef0838306764c9156655.tar
gsoc2013-empathy-45e0ed0dd99ba9909721ef0838306764c9156655.tar.gz
gsoc2013-empathy-45e0ed0dd99ba9909721ef0838306764c9156655.tar.bz2
gsoc2013-empathy-45e0ed0dd99ba9909721ef0838306764c9156655.tar.lz
gsoc2013-empathy-45e0ed0dd99ba9909721ef0838306764c9156655.tar.xz
gsoc2013-empathy-45e0ed0dd99ba9909721ef0838306764c9156655.tar.zst
gsoc2013-empathy-45e0ed0dd99ba9909721ef0838306764c9156655.zip
tp-chat: use TpAccountChannelRequest
-rw-r--r--libempathy/empathy-tp-chat.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 0ec866617..9a4e56acb 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -111,6 +111,20 @@ tp_chat_async_cb (TpChannel *proxy,
}
static void
+create_conference_cb (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
+{
+ GError *error = NULL;
+
+ if (!tp_account_channel_request_create_channel_finish (
+ TP_ACCOUNT_CHANNEL_REQUEST (source), result, &error)) {
+ DEBUG ("Failed to create conference channel: %s", error->message);
+ g_error_free (error);
+ }
+}
+
+static void
tp_chat_add (EmpathyContactList *list,
EmpathyContact *contact,
const gchar *message)
@@ -129,14 +143,12 @@ tp_chat_add (EmpathyContactList *list,
tp_cli_channel_interface_group_call_add_members (priv->channel,
-1, &handles, NULL, NULL, NULL, NULL, NULL);
} else if (priv->can_upgrade_to_muc) {
- EmpathyDispatcher *dispatcher;
+ TpAccountChannelRequest *req;
GHashTable *props;
const char *object_path;
GPtrArray channels = { (gpointer *) &object_path, 1 };
const char *invitees[2] = { NULL, };
- dispatcher = empathy_dispatcher_dup_singleton ();
-
invitees[0] = empathy_contact_get_id (contact);
object_path = tp_proxy_get_object_path (priv->channel);
@@ -152,13 +164,17 @@ tp_chat_add (EmpathyContactList *list,
/* FIXME: InvitationMessage ? */
NULL);
+ req = tp_account_channel_request_new (
+ empathy_get_account_for_connection (priv->connection), props,
+ EMPATHY_DISPATCHER_NON_USER_ACTION);
+
/* Although this is a MUC, it's anonymous, so CreateChannel is
- * valid.
- * props now belongs to EmpathyDispatcher, don't free it */
- empathy_dispatcher_create_channel (dispatcher, priv->connection,
- props, EMPATHY_DISPATCHER_NON_USER_ACTION, NULL, NULL);
+ * valid. */
+ tp_account_channel_request_create_channel_async (req, NULL, NULL,
+ create_conference_cb, NULL);
- g_object_unref (dispatcher);
+ g_object_unref (req);
+ g_hash_table_unref (props);
} else {
g_warning ("Cannot add to this channel");
}