diff options
-rw-r--r-- | libempathy/empathy-account.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libempathy/empathy-account.c b/libempathy/empathy-account.c index 39b5d0f08..7733f3556 100644 --- a/libempathy/empathy-account.c +++ b/libempathy/empathy-account.c @@ -36,6 +36,7 @@ #include <glib/gi18n-lib.h> #include "empathy-account.h" +#include "empathy-account-manager.h" #include "empathy-utils.h" #include "empathy-marshal.h" @@ -942,9 +943,13 @@ empathy_account_set_enabled_async (EmpathyAccount *account, gpointer user_data) { EmpathyAccountPriv *priv = GET_PRIV (account); + EmpathyAccountManager *acc_manager; GValue value = {0, }; GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, empathy_account_set_enabled_finish); + char *status = NULL; + char *status_message = NULL; + TpConnectionPresenceType presence; if (priv->enabled == enabled) { @@ -952,6 +957,18 @@ empathy_account_set_enabled_async (EmpathyAccount *account, return; } + acc_manager = empathy_account_manager_dup_singleton (); + presence = empathy_account_manager_get_requested_global_presence + (acc_manager, &status, &status_message); + + if (presence != TP_CONNECTION_PRESENCE_TYPE_UNSET) + empathy_account_request_presence (account, presence, status, + status_message); + + g_object_unref (acc_manager); + g_free (status); + g_free (status_message); + g_value_init (&value, G_TYPE_BOOLEAN); g_value_set_boolean (&value, enabled); |