diff options
-rw-r--r-- | src/empathy.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/empathy.c b/src/empathy.c index d5be4df8d..f23ce9145 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -38,6 +38,7 @@ #include <libebook/e-book.h> #include <libnotify/notify.h> +#include <telepathy-glib/dbus.h> #include <telepathy-glib/util.h> #include <libmissioncontrol/mc-account.h> #include <libmissioncontrol/mission-control.h> @@ -470,6 +471,7 @@ main (int argc, char *argv[]) gboolean hide_contact_list = FALSE; gboolean accounts_dialog = FALSE; GError *error = NULL; + TpDBusDaemon *dbus_daemon; GOptionEntry options[] = { { "no-connect", 'n', 0, G_OPTION_ARG_NONE, &no_connect, @@ -547,6 +549,23 @@ main (int argc, char *argv[]) g_warning ("Cannot create the 'empathy' bacon connection."); } + /* Take well-known name */ + dbus_daemon = tp_dbus_daemon_dup (&error); + if (error == NULL) { + if (!tp_dbus_daemon_request_name (dbus_daemon, + "org.gnome.Empathy", + TRUE, &error)) { + DEBUG ("Failed to request well-known name: %s", + error ? error->message : "no message"); + g_clear_error (&error); + } + g_object_unref (dbus_daemon); + } else { + DEBUG ("Failed to dup dbus daemon: %s", + error ? error->message : "no message"); + g_clear_error (&error); + } + /* Setting up MC */ mc = empathy_mission_control_dup_singleton (); g_signal_connect (mc, "ServiceEnded", |