From fe6101ebb054551b06c86f9c3b8bd31780264987 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Fri, 9 Jan 2009 16:15:59 +0000 Subject: Add support for DBus tubes Signed-off-by: Sjoerd Simons svn path=/trunk/; revision=2198 --- src/empathy-tube-dispatch.c | 32 ++++++++++++++++++++++++++------ 1 file 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); -- cgit v1.2.3