diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-04-16 16:22:54 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-04-16 16:22:54 +0900 |
commit | fa41fd7ef8b4706a65de73f8be3e9cff1b8b8014 (patch) | |
tree | 76ec39e7765dbd4b01058076f344cb36848ce0ae /lib | |
parent | 4c9ed0c64ec45c084af657e1fa188242a1d26d1a (diff) | |
download | libquotient-fa41fd7ef8b4706a65de73f8be3e9cff1b8b8014.tar.gz libquotient-fa41fd7ef8b4706a65de73f8be3e9cff1b8b8014.zip |
Connection::logout: ignore ContentAccessError
Closes #316.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connection.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 5ed72616..fa358e17 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -321,11 +321,14 @@ void Connection::checkAndConnect(const QString& userId, void Connection::logout() { auto job = callApi<LogoutJob>(); - connect( job, &LogoutJob::success, this, [this] { - stopSync(); - d->data->setToken({}); - emit stateChanged(); - emit loggedOut(); + connect( job, &LogoutJob::finished, this, [job,this] { + if (job->status().good() || job->error() == BaseJob::ContentAccessError) + { + stopSync(); + d->data->setToken({}); + emit stateChanged(); + emit loggedOut(); + } }); } |