diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2008-12-29 17:11:46 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-12-29 17:11:46 +0800 |
commit | d2381ad9d91773176a4a2daa309693cf39fc75bc (patch) | |
tree | 9d549219e124fc43565ed08694f23b6f161b7606 | |
parent | 0563614cc0902b6cd2d2d2b980baa720f87b453a (diff) | |
download | gsoc2013-empathy-d2381ad9d91773176a4a2daa309693cf39fc75bc.tar gsoc2013-empathy-d2381ad9d91773176a4a2daa309693cf39fc75bc.tar.gz gsoc2013-empathy-d2381ad9d91773176a4a2daa309693cf39fc75bc.tar.bz2 gsoc2013-empathy-d2381ad9d91773176a4a2daa309693cf39fc75bc.tar.lz gsoc2013-empathy-d2381ad9d91773176a4a2daa309693cf39fc75bc.tar.xz gsoc2013-empathy-d2381ad9d91773176a4a2daa309693cf39fc75bc.tar.zst gsoc2013-empathy-d2381ad9d91773176a4a2daa309693cf39fc75bc.zip |
Correctly escape service name in dtube handlers
Signed-off-by: Will Thompson <will.thompson@collabora.co.uk>
svn path=/trunk/; revision=2017
-rw-r--r-- | libempathy/empathy-tube-handler.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/libempathy/empathy-tube-handler.c b/libempathy/empathy-tube-handler.c index 2bbaea18c..146fe79ff 100644 --- a/libempathy/empathy-tube-handler.c +++ b/libempathy/empathy-tube-handler.c @@ -192,16 +192,20 @@ empathy_tube_handler_build_bus_name (TpTubeType type, const gchar *service) { gchar *service_escaped; gchar *str = NULL; + const gchar *prefix = NULL; g_return_val_if_fail (type <= TP_TUBE_TYPE_STREAM, NULL); g_return_val_if_fail (service != NULL, NULL); - service_escaped = tp_escape_as_identifier (service); if (type == TP_TUBE_TYPE_DBUS) - str = g_strdup_printf ("org.gnome.Empathy.DTubeHandler.%s", service); + prefix = "org.gnome.Empathy.DTubeHandler.%s"; else if (type == TP_TUBE_TYPE_STREAM) - str = g_strdup_printf ("org.gnome.Empathy.StreamTubeHandler.%s", service); + prefix = "org.gnome.Empathy.StreamTubeHandler.%s"; + else + g_return_val_if_reached (NULL); + service_escaped = tp_escape_as_identifier (service); + str = g_strdup_printf (prefix, service_escaped); g_free (service_escaped); return str; @@ -212,16 +216,20 @@ empathy_tube_handler_build_object_path (TpTubeType type, const gchar *service) { gchar *service_escaped; gchar *str = NULL; + const gchar *prefix = NULL; g_return_val_if_fail (type <= TP_TUBE_TYPE_STREAM, NULL); g_return_val_if_fail (service != NULL, NULL); - service_escaped = tp_escape_as_identifier (service); if (type == TP_TUBE_TYPE_DBUS) - str = g_strdup_printf ("/org/gnome/Empathy/DTubeHandler/%s", service); + prefix = "/org/gnome/Empathy/DTubeHandler/%s"; else if (type == TP_TUBE_TYPE_STREAM) - str = g_strdup_printf ("/org/gnome/Empathy/StreamTubeHandler/%s", service); + prefix = "/org/gnome/Empathy/StreamTubeHandler/%s"; + else + g_return_val_if_reached (NULL); + service_escaped = tp_escape_as_identifier (service); + str = g_strdup_printf (prefix, service_escaped); g_free (service_escaped); return str; |