It's more convenient and safe than hardcoding them everywhere.
#include "empathy-ft-factory.h"
#include "empathy-ft-handler.h"
#include "empathy-marshal.h"
+#include "empathy-request-util.h"
#include "empathy-utils.h"
/**
}
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,
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,
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,
#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"
}
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,