[empathy/mc5: 196/483] When an account is enabled, always align it to the global presence.



commit 45c7f5469ed08aeda3d54bf375d129cab5194cde
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Jul 24 01:45:59 2009 +0200

    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 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/libempathy/empathy-account-manager.c b/libempathy/empathy-account-manager.c
index 96e2e53..55f9da8 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;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]