]> git.0d.be Git - empathy.git/commitdiff
save the password before trying to connect the new account (#643690)
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 16 Mar 2011 13:03:40 +0000 (14:03 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 17 Mar 2011 13:44:27 +0000 (14:44 +0100)
libempathy/empathy-account-settings.c

index 41f663736a7d10ec6c906fd9c725b2d531e31889..0db28d7a3a875e9f484ca5d58af1f0bd04fd0567 100644 (file)
@@ -1438,6 +1438,9 @@ empathy_account_settings_account_updated (GObject *source,
     {
       if (priv->password != NULL)
         {
+          /* FIXME: we shouldn't save the password if we
+           * can't (MaySaveResponse=False) but we don't have API to check that
+           * at this point (fdo #35382). */
           empathy_keyring_set_account_password_async (priv->account, priv->password,
               empathy_account_settings_set_password_cb, settings);
         }
@@ -1485,6 +1488,19 @@ empathy_account_settings_created_cb (GObject *source,
   else
     {
       priv->account = g_object_ref (account);
+
+      if (priv->supports_sasl && priv->password != NULL)
+        {
+          /* Save the password before connecting */
+          /* FIXME: we shouldn't save the password if we
+           * can't (MaySaveResponse=False) but we don't have API to check that
+           * at this point (fdo #35382). */
+          empathy_keyring_set_account_password_async (priv->account,
+              priv->password, empathy_account_settings_set_password_cb,
+              settings);
+          return;
+        }
+
       empathy_account_settings_discard_changes (settings);
     }