diff options
Diffstat (limited to 'src/operator-status.cc')
-rw-r--r-- | src/operator-status.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/operator-status.cc b/src/operator-status.cc index 0cc5341..da37a55 100644 --- a/src/operator-status.cc +++ b/src/operator-status.cc @@ -33,9 +33,9 @@ const std::string StatusOperator::getName() const return "STATUS"; } -int StatusOperator::getState() const +Session::State StatusOperator::getState() const { - return Session::AUTHENTICATED | Session::SELECTED; + return Session::State(Session::AUTHENTICATED | Session::SELECTED); } Operator::ProcessResult StatusOperator::process(Depot &depot, Request &command) @@ -45,7 +45,7 @@ Operator::ProcessResult StatusOperator::process(Depot &depot, Request &command) Status status; if (!depot.getStatus(command.getMailbox(), status)) { session.setLastError(depot.getLastError()); - return NO; + return ProcessResult::NO; } bincClient << "* STATUS " << toImapString(command.getMailbox()) << " ("; @@ -72,16 +72,18 @@ Operator::ProcessResult StatusOperator::process(Depot &depot, Request &command) } bincClient << ")" << std::endl; - return OK; + return ProcessResult::OK; } -Operator::ParseResult StatusOperator::parse(Request &c_in) const +Parser::ParseResult StatusOperator::parse(Request &c_in) { + constexpr auto ACCEPT = Parser::ParseResult::ACCEPT; + Session &session = Session::getInstance(); - if (c_in.getUidMode()) return REJECT; + if (c_in.getUidMode()) return Parser::ParseResult::REJECT; - Operator::ParseResult res; + Parser::ParseResult res; if ((res = expectSPACE()) != ACCEPT) { session.setLastError("Expected SPACE"); return res; @@ -131,7 +133,7 @@ Operator::ParseResult StatusOperator::parse(Request &c_in) const if ((res = expectCRLF()) != ACCEPT) { session.setLastError("Expected CRLF"); - return ERROR; + return Parser::ParseResult::ERROR; } return ACCEPT; |