aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-22 17:22:04 -0500
committerTed Gould <ted@canonical.com>2009-09-22 17:22:04 -0500
commit4ec8c425cac932ff2d30f7e46f6bd79142384a50 (patch)
treea705a87e836f797496e09ceaf34539a5f737be0b
parent79e497d685774b2dbb310c54b7e587bd082f07d0 (diff)
downloadayatana-indicator-session-4ec8c425cac932ff2d30f7e46f6bd79142384a50.tar.gz
ayatana-indicator-session-4ec8c425cac932ff2d30f7e46f6bd79142384a50.tar.bz2
ayatana-indicator-session-4ec8c425cac932ff2d30f7e46f6bd79142384a50.zip
Connecting to change signal
-rw-r--r--src/status-provider-mc5.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/status-provider-mc5.c b/src/status-provider-mc5.c
index 5252e17..8ee174b 100644
--- a/src/status-provider-mc5.c
+++ b/src/status-provider-mc5.c
@@ -68,6 +68,7 @@ static void status_provider_mc5_finalize (GObject *object);
/* Internal Funcs */
static void set_status (StatusProvider * sp, StatusProviderStatus status);
static StatusProviderStatus get_status (StatusProvider * sp);
+static void presence_changed (EmpathyAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp);
G_DEFINE_TYPE (StatusProviderMC5, status_provider_mc5, STATUS_PROVIDER_TYPE);
@@ -98,6 +99,8 @@ status_provider_mc5_init (StatusProviderMC5 *self)
priv->status = STATUS_PROVIDER_STATUS_OFFLINE;
priv->manager = EMPATHY_ACCOUNT_MANAGER(g_object_new(EMPATHY_TYPE_ACCOUNT_MANAGER, NULL));
+ g_signal_connect(G_OBJECT(priv->manager), "global-presence-changed", G_CALLBACK(presence_changed), self);
+
return;
}
@@ -166,3 +169,14 @@ get_status (StatusProvider * sp)
return priv->status;
}
+static void
+presence_changed (EmpathyAccountManager * eam, guint type, const gchar * type_str, const gchar * message, StatusProviderMC5 * sp)
+{
+ StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(sp);
+
+ g_debug("MC5 Status changed: %d %s %s", type, type_str, message);
+
+ priv->status = type;
+
+ return;
+}