diff options
Diffstat (limited to 'src/operator-delete.cc')
-rw-r--r-- | src/operator-delete.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/operator-delete.cc b/src/operator-delete.cc index fb7ff4d..a706d01 100644 --- a/src/operator-delete.cc +++ b/src/operator-delete.cc @@ -26,29 +26,31 @@ const std::string DeleteOperator::getName() const return "DELETE"; } -int DeleteOperator::getState() const +Session::State DeleteOperator::getState() const { - return Session::AUTHENTICATED | Session::SELECTED; + return Session::State(Session::AUTHENTICATED | Session::SELECTED); } Operator::ProcessResult DeleteOperator::process(Depot &depot, Request &command) { if (depot.deleteMailbox(command.getMailbox())) { - return OK; + return Operator::ProcessResult::OK; } else { Session &session = Session::getInstance(); session.setLastError(depot.getLastError()); - return NO; + return Operator::ProcessResult::NO; } } -Operator::ParseResult DeleteOperator::parse(Request &c_in) const +Parser::ParseResult DeleteOperator::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 after DELETE"); return res; |