diff options
Diffstat (limited to 'src/operator-logout.cc')
-rw-r--r-- | src/operator-logout.cc | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/src/operator-logout.cc b/src/operator-logout.cc index 643d412..aabffdf 100644 --- a/src/operator-logout.cc +++ b/src/operator-logout.cc @@ -2,34 +2,28 @@ * @file operator-logout.cc * @brief Implementation of the LOGOUT command * @author Andreas Aardal Hanssen - * @date 2002-2005 + * @date 2002-2005 * ----------------------------------------------------------------- **/ -#include <string> -#include <iostream> - +#include "convert.h" +#include "depot.h" #include "iodevice.h" #include "iofactory.h" - #include "mailbox.h" +#include "operators.h" #include "recursivedescent.h" #include "session.h" -#include "convert.h" -#include "depot.h" -#include "operators.h" +#include <iostream> +#include <string> using namespace ::std; using namespace Binc; //---------------------------------------------------------------------- -LogoutOperator::LogoutOperator(void) -{ -} +LogoutOperator::LogoutOperator(void) {} //---------------------------------------------------------------------- -LogoutOperator::~LogoutOperator(void) -{ -} +LogoutOperator::~LogoutOperator(void) {} //---------------------------------------------------------------------- const string LogoutOperator::getName(void) const @@ -40,19 +34,16 @@ const string LogoutOperator::getName(void) const //---------------------------------------------------------------------- int LogoutOperator::getState(void) const { - return Session::NONAUTHENTICATED - | Session::AUTHENTICATED - | Session::SELECTED; + return Session::NONAUTHENTICATED | Session::AUTHENTICATED | Session::SELECTED; } //------------------------------------------------------------------------ -Operator::ProcessResult LogoutOperator::process(Depot &depot, - Request &command) +Operator::ProcessResult LogoutOperator::process(Depot &depot, Request &command) { bincClient << "* BYE Binc IMAP shutting down" << endl; bincClient << command.getTag() << " OK LOGOUT completed" << endl; bincClient.flush(); - + #ifdef BINCIMAPD Mailbox *mailbox = 0; if ((mailbox = depot.getSelected()) != 0) { @@ -60,7 +51,7 @@ Operator::ProcessResult LogoutOperator::process(Depot &depot, delete mailbox; } #endif - + Session &session = Session::getInstance(); session.setState(Session::LOGOUT); @@ -68,12 +59,11 @@ Operator::ProcessResult LogoutOperator::process(Depot &depot, } //---------------------------------------------------------------------- -Operator::ParseResult LogoutOperator::parse(Request & c_in) const +Operator::ParseResult LogoutOperator::parse(Request &c_in) const { Session &session = Session::getInstance(); - if (c_in.getUidMode()) - return REJECT; + if (c_in.getUidMode()) return REJECT; Operator::ParseResult res; if ((res = expectCRLF()) != ACCEPT) { |