summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-08 14:10:26 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-08 14:10:26 +0100
commit0277baf81448b0ec0fbbd92b21c321f91ba994d0 (patch)
tree6bccf0caf852a59df495d7157e71337b9350a349 /examples
parenta41d7ee237918584ea45405d20dee4f680fe7071 (diff)
downloadsink-0277baf81448b0ec0fbbd92b21c321f91ba994d0.tar.gz
sink-0277baf81448b0ec0fbbd92b21c321f91ba994d0.zip
The logout command will never be executed if the session is not
connected.
Diffstat (limited to 'examples')
-rw-r--r--examples/imapresource/imapserverproxy.cpp6
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
177KAsync::Job<SelectResult> ImapServerProxy::select(const QString &mailbox) 181KAsync::Job<SelectResult> ImapServerProxy::select(const QString &mailbox)