]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-share-my-desktop.c
Merge remote-tracking branch 'origin/gnome-3-8'
[empathy.git] / libempathy-gtk / empathy-share-my-desktop.c
index 6456d4859c55ed297dbffa306987d834b81aec46..9c29533c7d8e2a00bee4c58d4698c452176f22c2 100644 (file)
  * Authors: Arnaud Maillet <arnaud.maillet@collabora.co.uk>
  */
 
-#include <gtk/gtk.h>
-
-#include <dbus/dbus-glib.h>
-#include <telepathy-glib/util.h>
-#include <telepathy-glib/contact.h>
-#include <telepathy-glib/channel.h>
-#include <telepathy-glib/interfaces.h>
-
-#include <libempathy/empathy-dispatcher.h>
+#include "config.h"
+#include "empathy-share-my-desktop.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_SHARE_DESKTOP
-#include <libempathy/empathy-debug.h>
+#include "empathy-debug.h"
 
-#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 +56,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 +66,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, TP_USER_ACTION_TIME_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);
 }