aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-10 23:25:35 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-11 18:27:58 +0800
commitc6840c1afba475378163f5bb54cc1abcbc2deccc (patch)
treecb7c6b05e75383caf43aa66e8ea990ba73b0d77d /libempathy-gtk
parent45e0ed0dd99ba9909721ef0838306764c9156655 (diff)
downloadgsoc2013-empathy-c6840c1afba475378163f5bb54cc1abcbc2deccc.tar
gsoc2013-empathy-c6840c1afba475378163f5bb54cc1abcbc2deccc.tar.gz
gsoc2013-empathy-c6840c1afba475378163f5bb54cc1abcbc2deccc.tar.bz2
gsoc2013-empathy-c6840c1afba475378163f5bb54cc1abcbc2deccc.tar.lz
gsoc2013-empathy-c6840c1afba475378163f5bb54cc1abcbc2deccc.tar.xz
gsoc2013-empathy-c6840c1afba475378163f5bb54cc1abcbc2deccc.tar.zst
gsoc2013-empathy-c6840c1afba475378163f5bb54cc1abcbc2deccc.zip
share-my-desktop: use TpAccountChannelRequest
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-share-my-desktop.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-share-my-desktop.c b/libempathy-gtk/empathy-share-my-desktop.c
index 6456d4859..a630fc2a5 100644
--- a/libempathy-gtk/empathy-share-my-desktop.c
+++ b/libempathy-gtk/empathy-share-my-desktop.c
@@ -21,6 +21,7 @@
#include <gtk/gtk.h>
#include <dbus/dbus-glib.h>
+#include <telepathy-glib/account-channel-request.h>
#include <telepathy-glib/util.h>
#include <telepathy-glib/contact.h>
#include <telepathy-glib/channel.h>
@@ -33,10 +34,25 @@
#include "empathy-share-my-desktop.h"
+static void
+create_tube_channel_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 tube channel: %s", error->message);
+ g_error_free (error);
+ }
+}
+
void
empathy_share_my_desktop_share_with_contact (EmpathyContact *contact)
{
- EmpathyDispatcher *dispatcher;
+ TpAccountChannelRequest *req;
GHashTable *request;
TpContact *tp_contact;
@@ -50,8 +66,6 @@ empathy_share_my_desktop_share_with_contact (EmpathyContact *contact)
return;
}
- dispatcher = empathy_dispatcher_dup_singleton ();
-
request = tp_asv_new (
TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
TP_IFACE_CHANNEL_TYPE_STREAM_TUBE,
@@ -62,10 +76,12 @@ empathy_share_my_desktop_share_with_contact (EmpathyContact *contact)
TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE, G_TYPE_STRING, "rfb",
NULL);
- empathy_dispatcher_create_channel (dispatcher,
- tp_contact_get_connection (tp_contact), request,
- EMPATHY_DISPATCHER_CURRENT_TIME,
- NULL, NULL);
+ req = tp_account_channel_request_new (empathy_contact_get_account (contact),
+ request, EMPATHY_DISPATCHER_CURRENT_TIME);
+
+ tp_account_channel_request_create_channel_async (req, NULL, NULL,
+ create_tube_channel_cb, NULL);
- g_object_unref (dispatcher);
+ g_object_unref (req);
+ g_hash_table_unref (request);
}