diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-10-11 19:28:50 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-10-11 19:28:50 +0200 |
commit | 3ea7edf8c9bf7583c426178d4aaff4fb5b736bd2 (patch) | |
tree | ae78ebf9e9d1f70da8a6fdad1504063644ee8f1e /src/operator-subscribe.cc | |
parent | 1a7c572099edf744d6bb67318cff215de3fcd897 (diff) |
use some enum classes
move ParseResult to recursivedescent.h
Diffstat (limited to 'src/operator-subscribe.cc')
-rw-r--r-- | src/operator-subscribe.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/operator-subscribe.cc b/src/operator-subscribe.cc index b05590b..3209986 100644 --- a/src/operator-subscribe.cc +++ b/src/operator-subscribe.cc @@ -28,9 +28,9 @@ const string SubscribeOperator::getName() const return "SUBSCRIBE"; } -int SubscribeOperator::getState() const +Session::State SubscribeOperator::getState() const { - return Session::AUTHENTICATED | Session::SELECTED; + return Session::State(Session::AUTHENTICATED | Session::SELECTED); } Operator::ProcessResult SubscribeOperator::process(Depot &depot, Request &command) @@ -42,32 +42,32 @@ Operator::ProcessResult SubscribeOperator::process(Depot &depot, Request &comman depot.subscribeTo(canonmailbox); depot.saveSubscribes(); - return OK; + return ProcessResult::OK; } -Operator::ParseResult SubscribeOperator::parse(Request &c_in) const +Parser::ParseResult SubscribeOperator::parse(Request &c_in) { Session &session = Session::getInstance(); - if (c_in.getUidMode()) return REJECT; + if (c_in.getUidMode()) return Parser::ParseResult::REJECT; - Operator::ParseResult res; - if ((res = expectSPACE()) != ACCEPT) { + Parser::ParseResult res; + if ((res = expectSPACE()) != Parser::ParseResult::ACCEPT) { session.setLastError("Expected SPACE"); return res; } string mailbox; - if ((res = expectMailbox(mailbox)) != ACCEPT) { + if ((res = expectMailbox(mailbox)) != Parser::ParseResult::ACCEPT) { session.setLastError("Expected mailbox"); return res; } c_in.setMailbox(mailbox); - if ((res = expectCRLF()) != ACCEPT) { + if ((res = expectCRLF()) != Parser::ParseResult::ACCEPT) { session.setLastError("Expected CRLF"); return res; } - return ACCEPT; + return Parser::ParseResult::ACCEPT; } |