1
=== modified file 'configure.ac'
2
--- configure.ac 2009-12-08 13:36:06 +0000
3
+++ configure.ac 2009-12-08 13:40:34 +0000
7
DBUSMENUGLIB_REQUIRED_VERSION=0.1.1
8
-LIBEMPATHY_REQUIRED_VERSION=2.27.0
9
+TELEPATHYGLIB_REQUIRED_VERSION=0.9.0
11
PKG_CHECK_MODULES(STATUSSERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION
12
- libempathy >= $LIBEMPATHY_REQUIRED_VERSION)
13
+ telepathy-glib >= $TELEPATHYGLIB_REQUIRED_VERSION)
15
AC_SUBST(STATUSERVICE_CFLAGS)
16
AC_SUBST(STATUSERVICE_LIBS)
18
=== modified file 'src/status-provider-mc5.c'
19
--- src/status-provider-mc5.c 2009-12-08 13:38:42 +0000
20
+++ src/status-provider-mc5.c 2009-12-08 16:01:06 +0000
25
-#include "libempathy/empathy-account-manager.h"
26
+#include <telepathy-glib/account-manager.h>
28
#include "status-provider.h"
29
#include "status-provider-mc5.h"
32
typedef struct _StatusProviderMC5Private StatusProviderMC5Private;
33
struct _StatusProviderMC5Private {
34
- EmpathyAccountManager * manager;
35
+ TpAccountManager * manager;
36
StatusProviderStatus status;
37
DBusGProxy * dbus_proxy;
41
static void set_status (StatusProvider * sp, StatusProviderStatus status);
42
static StatusProviderStatus get_status (StatusProvider * sp);
43
-static void presence_changed (EmpathyAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp);
44
+static void presence_changed (TpAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp);
45
static void dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderMC5 * self);
46
static void mc5_exists_cb (DBusGProxy * proxy, gboolean exists, GError * error, gpointer userdata);
52
-/* Build our empathy account manager instance if we don't
53
+/* Build our telepathy account manager instance if we don't
56
build_eam (StatusProviderMC5 * self)
58
StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(self);
59
+ static TpDBusDaemon *daemon = NULL;
60
+ GError *error = NULL;
62
if (priv->manager != NULL) {
66
- priv->manager = EMPATHY_ACCOUNT_MANAGER(g_object_new(EMPATHY_TYPE_ACCOUNT_MANAGER, NULL));
67
- g_signal_connect(G_OBJECT(priv->manager), "global-presence-changed", G_CALLBACK(presence_changed), self);
68
+ /* the daemon is used to communicate via DBus */
69
+ daemon = tp_dbus_daemon_dup(&error);
73
+ g_debug("Cannot create DBus daemon: %s\n", error->message);
74
+ g_error_free(error);
78
+ priv->manager = TP_ACCOUNT_MANAGER (g_object_new (TP_TYPE_ACCOUNT_MANAGER,
79
+ "dbus-daemon", daemon,
80
+ "dbus-connection", ((TpProxy *) daemon)->dbus_connection,
81
+ "bus-name", "org.freedesktop.Telepathy.MissionControl5",
82
+ "object-path", "/org/freedesktop/Telepathy/AccountManager",
84
+ g_signal_connect(G_OBJECT(priv->manager), "most-available-presence-changed", G_CALLBACK(presence_changed), self);
89
/* Creating an instance of the status provider. We set the variables
90
- and create an EmpathyAccountManager object. It does all the hard
91
+ and create an TpAccountManager object. It does all the hard
92
work in this module of tracking MissionControl and enumerating the
93
accounts and all that jazz. */
96
StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(sp);
98
build_eam(STATUS_PROVIDER_MC5(sp));
100
- empathy_account_manager_request_global_presence(priv->manager, sp_to_tp_map[status], sp_to_mc_map[status], "");
101
+ tp_account_manager_set_all_requested_presences(priv->manager, sp_to_tp_map[status], sp_to_mc_map[status], "");
105
@@ -287,11 +302,11 @@
109
-/* A signal handler for when the EmpatyAccountManager believes
110
+/* A signal handler for when the TpAccountManager believes
111
that the global status has changed. It roughly calculates this
112
by finding the most available of all accounts that are active. */
114
-presence_changed (EmpathyAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp)
115
+presence_changed (TpAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp)
117
StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(sp);