]> git.0d.be Git - empathy.git/commitdiff
Add support for DBus tubes
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Fri, 9 Jan 2009 16:15:59 +0000 (16:15 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 9 Jan 2009 16:15:59 +0000 (16:15 +0000)
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
svn path=/trunk/; revision=2198

src/empathy-tube-dispatch.c

index 0392b118ddaf5e895d8581550581d12f11fda927..fcf94e8ac4a883bfb119151a577676cc0dcd2f10 100644 (file)
@@ -139,22 +139,42 @@ empathy_tube_dispatch_constructed (GObject *object)
   TpChannel *channel;
   GHashTable *properties;
   const gchar *service;
+  const gchar *channel_type;
+  EmpathyTubeType type;
 
   priv->dbus = tp_dbus_daemon_new (tp_get_bus());
 
   channel = empathy_dispatch_operation_get_channel (priv->operation);
   properties = tp_channel_borrow_immutable_properties (channel);
 
-  service = tp_asv_get_string (properties,
-    EMP_IFACE_CHANNEL_TYPE_STREAM_TUBE  ".Service");
+  channel_type = tp_asv_get_string (properties,
+    TP_IFACE_CHANNEL ".ChannelType");
+  if (channel_type == NULL)
+    goto failed;
+
+  if (!tp_strdiff (channel_type, EMP_IFACE_CHANNEL_TYPE_STREAM_TUBE))
+    {
+      type = EMPATHY_TYPE_STREAM_TUBE;
+      service = tp_asv_get_string (properties,
+        EMP_IFACE_CHANNEL_TYPE_STREAM_TUBE  ".Service");
+    }
+  else if (!tp_strdiff (channel_type, EMP_IFACE_CHANNEL_TYPE_DBUS_TUBE))
+    {
+      type = EMPATHY_TYPE_DBUS_TUBE;
+      service = tp_asv_get_string (properties,
+        EMP_IFACE_CHANNEL_TYPE_DBUS_TUBE  ".ServiceName");
+    }
+  else
+    {
+      goto failed;
+    }
+
 
   if (service == NULL)
     goto failed;
 
-  priv->bus_name = empathy_tube_handler_build_bus_name (
-    TP_TUBE_TYPE_STREAM, service);
-  priv->object_path =
-    empathy_tube_handler_build_object_path (TP_TUBE_TYPE_STREAM, service);
+  priv->bus_name = empathy_tube_handler_build_bus_name (type, service);
+  priv->object_path = empathy_tube_handler_build_object_path (type, service);
 
   priv->service = g_strdup (service);