From d539c58cdce66db1be5cd49181d47cbf64731c49 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 17 Aug 2009 16:52:43 -0500 Subject: Initially querying the status so that when we start, we get the right value. --- src/status-provider-pidgin.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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 @@ -135,6 +135,22 @@ saved_status_to_type (StatusProviderPidgin * spp, gint savedstatus) return; } +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) { @@ -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; -- cgit v1.2.3