diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-08 14:10:26 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-08 14:10:26 +0100 |
commit | 0277baf81448b0ec0fbbd92b21c321f91ba994d0 (patch) | |
tree | 6bccf0caf852a59df495d7157e71337b9350a349 | |
parent | a41d7ee237918584ea45405d20dee4f680fe7071 (diff) | |
download | sink-0277baf81448b0ec0fbbd92b21c321f91ba994d0.tar.gz sink-0277baf81448b0ec0fbbd92b21c321f91ba994d0.zip |
The logout command will never be executed if the session is not
connected.
-rw-r--r-- | examples/imapresource/imapserverproxy.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/imapresource/imapserverproxy.cpp b/examples/imapresource/imapserverproxy.cpp index 4ef3000..e329911 100644 --- a/examples/imapresource/imapserverproxy.cpp +++ b/examples/imapresource/imapserverproxy.cpp | |||
@@ -171,7 +171,11 @@ KAsync::Job<void> ImapServerProxy::logout() | |||
171 | return KAsync::null(); | 171 | return KAsync::null(); |
172 | } | 172 | } |
173 | } | 173 | } |
174 | return runJob(new KIMAP2::LogoutJob(mSession)); | 174 | if (mSession->state() == KIMAP2::Session::State::Authenticated || mSession->state() == KIMAP2::Session::State::Selected) { |
175 | return runJob(new KIMAP2::LogoutJob(mSession)); | ||
176 | } else { | ||
177 | return KAsync::null(); | ||
178 | } | ||
175 | } | 179 | } |
176 | 180 | ||
177 | KAsync::Job<SelectResult> ImapServerProxy::select(const QString &mailbox) | 181 | KAsync::Job<SelectResult> ImapServerProxy::select(const QString &mailbox) |