summaryrefslogtreecommitdiff
path: root/src/operator-status.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/operator-status.cc')
-rw-r--r--src/operator-status.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/operator-status.cc b/src/operator-status.cc
index da37a55..4c2588f 100644
--- a/src/operator-status.cc
+++ b/src/operator-status.cc
@@ -75,7 +75,7 @@ Operator::ProcessResult StatusOperator::process(Depot &depot, Request &command)
return ProcessResult::OK;
}
-Parser::ParseResult StatusOperator::parse(Request &c_in)
+Parser::ParseResult StatusOperator::parse(Request &c_in, Parser &p)
{
constexpr auto ACCEPT = Parser::ParseResult::ACCEPT;
@@ -84,54 +84,54 @@ Parser::ParseResult StatusOperator::parse(Request &c_in)
if (c_in.getUidMode()) return Parser::ParseResult::REJECT;
Parser::ParseResult res;
- if ((res = expectSPACE()) != ACCEPT) {
+ if ((res = p.expectSPACE()) != ACCEPT) {
session.setLastError("Expected SPACE");
return res;
}
std::string mailbox;
- if ((res = expectMailbox(mailbox)) != ACCEPT) {
+ if ((res = p.expectMailbox(mailbox)) != ACCEPT) {
session.setLastError("Expected mailbox");
return res;
}
c_in.setMailbox(mailbox);
- if ((res = expectSPACE()) != ACCEPT) {
+ if ((res = p.expectSPACE()) != ACCEPT) {
session.setLastError("Expected SPACE");
return res;
}
- if ((res = expectThisString("(")) != ACCEPT) {
+ if ((res = p.expectThisString("(")) != ACCEPT) {
session.setLastError("Expected (");
return res;
}
while (1) {
- if ((res = expectThisString("MESSAGES")) == ACCEPT) {
+ if ((res = p.expectThisString("MESSAGES")) == ACCEPT) {
c_in.getStatuses().push_back("MESSAGES");
- } else if ((res = expectThisString("RECENT")) == ACCEPT) {
+ } else if ((res = p.expectThisString("RECENT")) == ACCEPT) {
c_in.getStatuses().push_back("RECENT");
- } else if ((res = expectThisString("UIDNEXT")) == ACCEPT) {
+ } else if ((res = p.expectThisString("UIDNEXT")) == ACCEPT) {
c_in.getStatuses().push_back("UIDNEXT");
- } else if ((res = expectThisString("UIDVALIDITY")) == ACCEPT) {
+ } else if ((res = p.expectThisString("UIDVALIDITY")) == ACCEPT) {
c_in.getStatuses().push_back("UIDVALIDITY");
- } else if ((res = expectThisString("UNSEEN")) == ACCEPT) {
+ } else if ((res = p.expectThisString("UNSEEN")) == ACCEPT) {
c_in.getStatuses().push_back("UNSEEN");
} else {
session.setLastError("Expected status_att");
return res;
}
- if (expectSPACE() != ACCEPT) break;
+ if (p.expectSPACE() != ACCEPT) break;
}
- if ((res = expectThisString(")")) != ACCEPT) {
+ if ((res = p.expectThisString(")")) != ACCEPT) {
session.setLastError("Expected )");
return res;
}
- if ((res = expectCRLF()) != ACCEPT) {
+ if ((res = p.expectCRLF()) != ACCEPT) {
session.setLastError("Expected CRLF");
return Parser::ParseResult::ERROR;
}