aboutsummaryrefslogtreecommitdiff
path: root/src/status-provider-pidgin.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-08-17 16:52:43 -0500
committerTed Gould <ted@canonical.com>2009-08-17 16:52:43 -0500
commitd539c58cdce66db1be5cd49181d47cbf64731c49 (patch)
tree9397e741a3fc5ff2dbec98dffa0952de701c5e95 /src/status-provider-pidgin.c
parent7917b6f262b675546cd878925c5601ba6b9da116 (diff)
downloadayatana-indicator-session-d539c58cdce66db1be5cd49181d47cbf64731c49.tar.gz
ayatana-indicator-session-d539c58cdce66db1be5cd49181d47cbf64731c49.tar.bz2
ayatana-indicator-session-d539c58cdce66db1be5cd49181d47cbf64731c49.zip
Initially querying the status so that when we start, we get the right value.
Diffstat (limited to 'src/status-provider-pidgin.c')
-rw-r--r--src/status-provider-pidgin.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/status-provider-pidgin.c b/src/status-provider-pidgin.c
index 53b8e6d..052ce12 100644
--- a/src/status-provider-pidgin.c
+++ b/src/status-provider-pidgin.c
@@ -136,6 +136,22 @@ saved_status_to_type (StatusProviderPidgin * spp, gint savedstatus)
}
static void
+savedstatus_cb (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata)
+{
+ GError * error = NULL;
+ gint status = 0;
+ if (!dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_INT, &status, G_TYPE_INVALID)) {
+ g_warning("Unable to get saved status from Pidgin: %s", error->message);
+ g_error_free(error);
+ return;
+ }
+
+ saved_status_to_type(STATUS_PROVIDER_PIDGIN(userdata), status);
+ return;
+}
+
+
+static void
changed_status (DBusGProxy * proxy, gint savedstatus, GError ** error, StatusProviderPidgin * spp)
{
saved_status_to_type(spp, savedstatus);
@@ -199,6 +215,13 @@ status_provider_pidgin_init (StatusProviderPidgin *self)
G_CALLBACK(changed_status),
(void *)self,
NULL);
+
+ dbus_g_proxy_begin_call(priv->proxy,
+ "PurpleSavedstatusGetCurrent",
+ savedstatus_cb,
+ self,
+ NULL,
+ G_TYPE_INVALID);
}
return;