From 45c7f5469ed08aeda3d54bf375d129cab5194cde Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Fri, 24 Jul 2009 01:45:59 +0200 Subject: [PATCH] When an account is enabled, always align it to the global presence. Before, this was only done for newly created accounts, and not every time any account was enabled. --- libempathy/empathy-account-manager.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libempathy/empathy-account-manager.c b/libempathy/empathy-account-manager.c index 96e2e538..55f9da83 100644 --- a/libempathy/empathy-account-manager.c +++ b/libempathy/empathy-account-manager.c @@ -104,8 +104,16 @@ emp_account_enabled_cb (EmpathyAccount *account, GParamSpec *spec, gpointer manager) { + EmpathyAccountManagerPriv *priv = GET_PRIV (manager); + if (empathy_account_is_enabled (account)) - g_signal_emit (manager, signals[ACCOUNT_ENABLED], 0, account); + { + g_signal_emit (manager, signals[ACCOUNT_ENABLED], 0, account); + + /* set the desired global presence on the account */ + empathy_account_request_presence (account, priv->desired_presence, + priv->desired_status, priv->desired_status_message); + } else g_signal_emit (manager, signals[ACCOUNT_DISABLED], 0, account); } @@ -904,7 +912,6 @@ empathy_account_manager_create_account_finish ( EmpathyAccountManager *manager, GAsyncResult *result, GError **error) { EmpathyAccount *retval; - EmpathyAccountManagerPriv *priv = GET_PRIV (manager); if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) @@ -916,12 +923,6 @@ empathy_account_manager_create_account_finish ( retval = EMPATHY_ACCOUNT (g_simple_async_result_get_op_res_gpointer ( G_SIMPLE_ASYNC_RESULT (result))); - /* if we have an account, it's ready, as we waited for it. - * request the global presence now. - */ - empathy_account_request_presence (retval, priv->desired_presence, - priv->desired_status, priv->desired_status_message); - return retval; } -- 2.39.2