diff options
Diffstat (limited to 'src/operator-copy.cc')
-rw-r--r-- | src/operator-copy.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/operator-copy.cc b/src/operator-copy.cc index 06204b2..b2aaa62 100644 --- a/src/operator-copy.cc +++ b/src/operator-copy.cc @@ -28,7 +28,7 @@ const string CopyOperator::getName() const return "COPY"; } -int CopyOperator::getState() const +Session::State CopyOperator::getState() const { return Session::SELECTED; } @@ -46,7 +46,7 @@ Operator::ProcessResult CopyOperator::process(Depot &depot, Request &command) if (destMailbox == nullptr) { session.setResponseCode("TRYCREATE"); session.setLastError("invalid mailbox " + toImapString(dmailbox)); - return NO; + return Operator::ProcessResult::NO; } unsigned int mode = Mailbox::SKIP_EXPUNGED; @@ -103,14 +103,14 @@ Operator::ProcessResult CopyOperator::process(Depot &depot, Request &command) if (!success && !destMailbox->rollBackNewMessages()) { session.setLastError("Failed to rollback after unsuccessful copy: " + destMailbox->getLastError()); - return NO; + return Operator::ProcessResult::NO; } if (success) { if (!destMailbox->commitNewMessages(depot.mailboxToFilename(toCanonMailbox(dmailbox)))) { session.setLastError("Failed to commit after successful copy: " + destMailbox->getLastError()); - return NO; + return Operator::ProcessResult::NO; } } @@ -120,14 +120,16 @@ Operator::ProcessResult CopyOperator::process(Depot &depot, Request &command) "more information."); } - return success ? OK : NO; + return success ? Operator::ProcessResult::OK : Operator::ProcessResult::NO; } -Operator::ParseResult CopyOperator::parse(Request &c_in) const +Parser::ParseResult CopyOperator::parse(Request &c_in) { + constexpr auto ACCEPT = Parser::ParseResult::ACCEPT; + Session &session = Session::getInstance(); - Operator::ParseResult res; + Parser::ParseResult res; if ((res = expectSPACE()) != ACCEPT) { session.setLastError("Expected SPACE after COPY"); return res; |