[Pkg-owncloud-commits] [owncloud-client] 16/30: Do not wipe the credentials from config for reconnect.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Mar 15 21:28:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 9eb3452a71cc98200022275101b728e910371897
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Mon Mar 3 16:39:38 2014 +0100

    Do not wipe the credentials from config for reconnect.
    
    This should fix bug #1491
---
 src/mirall/networkjobs.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/mirall/networkjobs.cpp b/src/mirall/networkjobs.cpp
index 040d0f1..f739f40 100644
--- a/src/mirall/networkjobs.cpp
+++ b/src/mirall/networkjobs.cpp
@@ -145,13 +145,20 @@ void AbstractNetworkJob::slotFinished()
     AbstractCredentials *creds = _account->credentials();
     if (!creds->stillValid(_reply) &&! _ignoreCredentialFailure
             && _account->state() != Account::InvalidCredidential) {
-        _account->setState(Account::InvalidCredidential);
-
         // invalidate & forget token/password
         // but try to re-sign in.
         connect( creds, SIGNAL(fetched()),
                  qApp, SLOT(slotCredentialsFetched()), Qt::UniqueConnection);
-        creds->invalidateAndFetch(_account);   // this triggers Application::runValidator when the credidentials are fetched
+
+        // If the state is (still) disconnected, it is the first attempt to connect and
+        // the credentials must be fetched.
+        if(_account->state() == Account::Disconnected) {
+            creds->fetch(_account);
+        } else {
+            // Note: Invalidate removes the creds from the keychain!
+            creds->invalidateAndFetch(_account);   // this triggers Application::runValidator when the credidentials are fetched
+        }
+        _account->setState(Account::InvalidCredidential);
     }
     deleteLater();
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list