aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-tube-dispatch.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-01-10 00:15:59 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-10 00:15:59 +0800
commitfe6101ebb054551b06c86f9c3b8bd31780264987 (patch)
treea30f9e7e87385f597674070af75b51eb611aa68e /src/empathy-tube-dispatch.c
parent83b767595192e0838acb3163d0d23d57a0f1ec3e (diff)
downloadgsoc2013-empathy-fe6101ebb054551b06c86f9c3b8bd31780264987.tar
gsoc2013-empathy-fe6101ebb054551b06c86f9c3b8bd31780264987.tar.gz
gsoc2013-empathy-fe6101ebb054551b06c86f9c3b8bd31780264987.tar.bz2
gsoc2013-empathy-fe6101ebb054551b06c86f9c3b8bd31780264987.tar.lz
gsoc2013-empathy-fe6101ebb054551b06c86f9c3b8bd31780264987.tar.xz
gsoc2013-empathy-fe6101ebb054551b06c86f9c3b8bd31780264987.tar.zst
gsoc2013-empathy-fe6101ebb054551b06c86f9c3b8bd31780264987.zip
Add support for DBus tubes
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2198
Diffstat (limited to 'src/empathy-tube-dispatch.c')
-rw-r--r--src/empathy-tube-dispatch.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/empathy-tube-dispatch.c b/src/empathy-tube-dispatch.c
index 0392b118d..fcf94e8ac 100644
--- a/src/empathy-tube-dispatch.c
+++ b/src/empathy-tube-dispatch.c
@@ -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);