summaryrefslogtreecommitdiff
path: root/src/operator-rename.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/operator-rename.cc')
-rw-r--r--src/operator-rename.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/operator-rename.cc b/src/operator-rename.cc
index c6c01f6..b8298f8 100644
--- a/src/operator-rename.cc
+++ b/src/operator-rename.cc
@@ -29,9 +29,9 @@ const string RenameOperator::getName() const
return "RENAME";
}
-int RenameOperator::getState() const
+Session::State RenameOperator::getState() const
{
- return Session::AUTHENTICATED | Session::SELECTED;
+ return Session::State(Session::AUTHENTICATED | Session::SELECTED);
}
Operator::ProcessResult RenameOperator::process(Depot &depot, Request &command)
@@ -48,27 +48,29 @@ Operator::ProcessResult RenameOperator::process(Depot &depot, Request &command)
session.setLastError("Sorry, renaming INBOX is not yet supported"
" by this IMAP server. Try copying the messages"
" instead");
- return NO;
+ return Operator::ProcessResult::NO;
}
if (canondestmailbox == "INBOX") {
session.setLastError("It is not allowed to rename a mailbox to INBOX");
- return NO;
+ return Operator::ProcessResult::NO;
}
if (depot.renameMailbox(canonmailbox, canondestmailbox))
- return OK;
+ return Operator::ProcessResult::OK;
else
- return NO;
+ return Operator::ProcessResult::NO;
}
-Operator::ParseResult RenameOperator::parse(Request &c_in) const
+Parser::ParseResult RenameOperator::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 RENAME");
return res;