]> git.0d.be Git - empathy.git/commitdiff
define constants for handler bus name
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 7 Mar 2011 13:54:01 +0000 (14:54 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 17 Mar 2011 08:53:49 +0000 (09:53 +0100)
It's more convenient and safe than hardcoding them everywhere.

libempathy/empathy-ft-factory.c
libempathy/empathy-request-util.h
src/empathy-chat-manager.c
src/empathy-streamed-media-factory.c

index 398474719ba99d672480028388346f891dfce9a6..5fb238a2b9e5efcab49e52954e485de0a8575f9b 100644 (file)
@@ -28,6 +28,7 @@
 #include "empathy-ft-factory.h"
 #include "empathy-ft-handler.h"
 #include "empathy-marshal.h"
+#include "empathy-request-util.h"
 #include "empathy-utils.h"
 
 /**
@@ -219,7 +220,7 @@ empathy_ft_factory_init (EmpathyFTFactory *self)
     }
 
   priv->handler = tp_simple_handler_new (dbus, FALSE, FALSE,
-      "Empathy.FileTransfer", FALSE, handle_channels_cb, self, NULL);
+      EMPATHY_FT_BUS_NAME_SUFFIX, FALSE, handle_channels_cb, self, NULL);
 
   tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
         TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
index 1073f0d5ef61a962af152f592e30931a463c4b0f..afb8013cbe67806e4ed6a0a837db7ddf85866a24 100644 (file)
 
 G_BEGIN_DECLS
 
+#define EMPATHY_CHAT_BUS_NAME_SUFFIX "Empathy.Chat"
+#define EMPATHY_CHAT_BUS_NAME TP_CLIENT_BUS_NAME_BASE EMPATHY_CHAT_BUS_NAME_SUFFIX
+
+#define EMPATHY_AV_BUS_NAME_SUFFIX "Empathy.AudioVideo"
+#define EMPATHY_AV_BUS_NAME TP_CLIENT_BUS_NAME_BASE EMPATHY_AV_BUS_NAME_SUFFIX
+
+#define EMPATHY_FT_BUS_NAME_SUFFIX "Empathy.FileTransfer"
+#define EMPATHY_FT_BUS_NAME TP_CLIENT_BUS_NAME_BASE EMPATHY_FT_BUS_NAME_SUFFIX
+
 /* Requesting 1 to 1 text channels */
 void empathy_chat_with_contact_id (TpAccount *account,
   const gchar *contact_id,
index c3488dc4511b102129f6df913fba33f245871f76..ff715fe375acab2604cd76be1efcb342befb024e 100644 (file)
@@ -286,8 +286,8 @@ empathy_chat_manager_init (EmpathyChatManager *self)
   priv->chatroom_mgr = empathy_chatroom_manager_dup_singleton (NULL);
 
   /* Text channels handler */
-  priv->handler = tp_simple_handler_new (dbus, FALSE, FALSE, "Empathy.Chat",
-      FALSE, handle_channels, self, NULL);
+  priv->handler = tp_simple_handler_new (dbus, FALSE, FALSE,
+      EMPATHY_CHAT_BUS_NAME_SUFFIX, FALSE, handle_channels, self, NULL);
 
   /* EmpathyTpChat relies on these features being prepared */
   tp_base_client_add_connection_features_varargs (priv->handler,
index 70b23794180c6c0415c3d030a0779c3fc430599f..e044a1b52b650dcad4673d00f632839ffa769d5b 100644 (file)
@@ -27,6 +27,7 @@
 #include <telepathy-glib/interfaces.h>
 #include <telepathy-glib/util.h>
 
+#include <libempathy/empathy-request-util.h>
 #include <libempathy/empathy-utils.h>
 
 #include "empathy-streamed-media-factory.h"
@@ -85,7 +86,7 @@ empathy_streamed_media_factory_init (EmpathyStreamedMediaFactory *obj)
     }
 
   priv->handler = tp_simple_handler_new (dbus, FALSE, FALSE,
-      "Empathy.AudioVideo", FALSE, handle_channels_cb, obj, NULL);
+      EMPATHY_AV_BUS_NAME_SUFFIX, FALSE, handle_channels_cb, obj, NULL);
 
   tp_base_client_take_handler_filter (priv->handler, tp_asv_new (
         TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,