summaryrefslogtreecommitdiff
path: root/src/operator-select.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/operator-select.cc')
-rw-r--r--src/operator-select.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/operator-select.cc b/src/operator-select.cc
index 64c4be6..1b0f5a4 100644
--- a/src/operator-select.cc
+++ b/src/operator-select.cc
@@ -1,9 +1,10 @@
-/** --------------------------------------------------------------------
+/**
* @file operator-select.cc
* @brief Implementation of the SELECT command.
* @author Andreas Aardal Hanssen
* @date 2002-2005
- * ----------------------------------------------------------------- **/
+ */
+
#include "convert.h"
#include "depot.h"
#include "iodevice.h"
@@ -16,28 +17,24 @@
#include <string>
-using namespace ::std;
using namespace Binc;
+using std::endl;
+using std::string;
-//----------------------------------------------------------------------
SelectOperator::SelectOperator(void) {}
-//----------------------------------------------------------------------
SelectOperator::~SelectOperator(void) {}
-//----------------------------------------------------------------------
const string SelectOperator::getName(void) const
{
return "SELECT";
}
-//----------------------------------------------------------------------
int SelectOperator::getState(void) const
{
return Session::NONAUTHENTICATED | Session::AUTHENTICATED | Session::SELECTED;
}
-//------------------------------------------------------------------------
Operator::ProcessResult SelectOperator::process(Depot &depot, Request &command)
{
Session &session = Session::getInstance();
@@ -47,14 +44,14 @@ Operator::ProcessResult SelectOperator::process(Depot &depot, Request &command)
const string &canonmailbox = toCanonMailbox(srcmailbox);
Mailbox *mailbox = depot.getSelected();
- if (mailbox != 0) {
+ if (mailbox != nullptr) {
mailbox->closeMailbox();
depot.resetSelected();
- mailbox = 0;
+ mailbox = nullptr;
}
mailbox = depot.get(canonmailbox);
- if (mailbox == 0) {
+ if (mailbox == nullptr) {
session.setLastError(depot.getLastError());
return NO;
}
@@ -84,9 +81,10 @@ Operator::ProcessResult SelectOperator::process(Depot &depot, Request &command)
pendingUpdates(mailbox, PendingUpdates::EXISTS | PendingUpdates::RECENT, false, true);
// unseen
- if (unseen != -1)
+ if (unseen != -1) {
bincClient << "*"
<< " OK [UNSEEN " << unseen << "] Message " << unseen << " is first unseen" << endl;
+ }
// uidvalidity
bincClient << "*"
@@ -113,7 +111,6 @@ Operator::ProcessResult SelectOperator::process(Depot &depot, Request &command)
return OK;
}
-//----------------------------------------------------------------------
Operator::ParseResult SelectOperator::parse(Request &c_in) const
{
Session &session = Session::getInstance();