summaryrefslogtreecommitdiff
path: root/src/operator-id.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/operator-id.cc')
-rw-r--r--src/operator-id.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/operator-id.cc b/src/operator-id.cc
index db5b79b..4d72320 100644
--- a/src/operator-id.cc
+++ b/src/operator-id.cc
@@ -27,9 +27,10 @@ const std::string IdOperator::getName() const
return "ID";
}
-int IdOperator::getState() const
+Session::State IdOperator::getState() const
{
- return Session::NONAUTHENTICATED | Session::AUTHENTICATED | Session::SELECTED;
+ return Session::State(Session::NONAUTHENTICATED | Session::AUTHENTICATED
+ | Session::SELECTED);
}
Operator::ProcessResult IdOperator::process(Depot &depot, Request &command)
@@ -37,16 +38,18 @@ Operator::ProcessResult IdOperator::process(Depot &depot, Request &command)
bincClient << "* ID (\"name\" \"Binc IMAP\""
<< " \"version\" \"" << BINC_VERSION "\")" << std::endl;
- return OK;
+ return Operator::ProcessResult::OK;
}
-Operator::ParseResult IdOperator::parse(Request &c_in) const
+Parser::ParseResult IdOperator::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 && (res = expectCRLF()) != ACCEPT) {
session.setLastError("Expected SPACE or CRLF");
return res;