From 0277baf81448b0ec0fbbd92b21c321f91ba994d0 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 8 Feb 2017 14:10:26 +0100 Subject: The logout command will never be executed if the session is not connected. --- examples/imapresource/imapserverproxy.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples/imapresource/imapserverproxy.cpp') 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 ImapServerProxy::logout() return KAsync::null(); } } - return runJob(new KIMAP2::LogoutJob(mSession)); + if (mSession->state() == KIMAP2::Session::State::Authenticated || mSession->state() == KIMAP2::Session::State::Selected) { + return runJob(new KIMAP2::LogoutJob(mSession)); + } else { + return KAsync::null(); + } } KAsync::Job ImapServerProxy::select(const QString &mailbox) -- cgit v1.2.3