summaryrefslogtreecommitdiff
path: root/src/operator-unsubscribe.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/operator-unsubscribe.cc')
-rw-r--r--src/operator-unsubscribe.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/operator-unsubscribe.cc b/src/operator-unsubscribe.cc
index 34b12a0..cafa10a 100644
--- a/src/operator-unsubscribe.cc
+++ b/src/operator-unsubscribe.cc
@@ -29,9 +29,9 @@ const string UnsubscribeOperator::getName() const
return "UNSUBSCRIBE";
}
-int UnsubscribeOperator::getState() const
+Session::State UnsubscribeOperator::getState() const
{
- return Session::AUTHENTICATED | Session::SELECTED;
+ return Session::State(Session::AUTHENTICATED | Session::SELECTED);
}
Operator::ProcessResult UnsubscribeOperator::process(Depot &depot, Request &command)
@@ -43,38 +43,38 @@ Operator::ProcessResult UnsubscribeOperator::process(Depot &depot, Request &comm
if (!depot.unsubscribeTo(canonmailbox)) {
Session &session = Session::getInstance();
session.setLastError("Not subscribed to " + toImapString(mailbox));
- return NO;
+ return ProcessResult::NO;
}
depot.saveSubscribes();
- return OK;
+ return ProcessResult::OK;
}
-Operator::ParseResult UnsubscribeOperator::parse(Request &c_in) const
+Parser::ParseResult UnsubscribeOperator::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;
}
- if ((res = expectCRLF()) != ACCEPT) {
+ if ((res = expectCRLF()) != Parser::ParseResult::ACCEPT) {
session.setLastError("Expected CRLF");
return res;
}
c_in.setMailbox(mailbox);
- return ACCEPT;
+ return Parser::ParseResult::ACCEPT;
}