summaryrefslogtreecommitdiff
path: root/src/operator-capability.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/operator-capability.cc')
-rw-r--r--src/operator-capability.cc35
1 files changed, 15 insertions, 20 deletions
diff --git a/src/operator-capability.cc b/src/operator-capability.cc
index bdead58..73f5a26 100644
--- a/src/operator-capability.cc
+++ b/src/operator-capability.cc
@@ -4,28 +4,24 @@
* @author Andreas Aardal Hanssen, Erwin Hoffmann
* @date 2002-2005, 2023
* ----------------------------------------------------------------- **/
-#include <string>
-
#include "depot.h"
+#include "globals.h"
#include "iodevice.h"
#include "iofactory.h"
#include "operators.h"
#include "recursivedescent.h"
#include "session.h"
-#include "globals.h"
+
+#include <string>
using namespace ::std;
using namespace Binc;
//----------------------------------------------------------------------
-CapabilityOperator::CapabilityOperator(void)
-{
-}
+CapabilityOperator::CapabilityOperator(void) {}
//----------------------------------------------------------------------
-CapabilityOperator::~CapabilityOperator(void)
-{
-}
+CapabilityOperator::~CapabilityOperator(void) {}
//----------------------------------------------------------------------
const string CapabilityOperator::getName(void) const
@@ -36,9 +32,7 @@ const string CapabilityOperator::getName(void) const
//----------------------------------------------------------------------
int CapabilityOperator::getState(void) const
{
- return Session::NONAUTHENTICATED
- | Session::AUTHENTICATED
- | Session::SELECTED;
+ return Session::NONAUTHENTICATED | Session::AUTHENTICATED | Session::SELECTED;
}
//----------------------------------------------------------------------
@@ -48,23 +42,24 @@ void CapabilityOperator::addCapability(const string &cap)
}
//----------------------------------------------------------------------
-Operator::ProcessResult CapabilityOperator::process(Depot &depot,
- Request &command)
+Operator::ProcessResult CapabilityOperator::process(Depot &depot, Request &command)
{
Session &session = Session::getInstance();
- bincClient << "* CAPABILITY " << IMAP_VERSION ;
+ bincClient << "* CAPABILITY " << IMAP_VERSION;
if (session.getState() == Session::NONAUTHENTICATED) {
- if (getenv("UCSPITLS"))
+ if (getenv("UCSPITLS"))
if (!session.command.ssl) bincClient << " STARTTLS";
- const string authmethods = session.getEnv("BINCIMAP_LOGIN");
- auto cram = authmethods.find("+CRAM-MD5");
+ const string authmethods = session.getEnv("BINCIMAP_LOGIN");
+ auto cram = authmethods.find("+CRAM-MD5");
if (session.command.ssl || session.hasEnv("ALLOW_NONSSL_PLAINTEXT_LOGINS")) {
- if (cram != string::npos) bincClient << " AUTH=LOGIN AUTH=PLAIN AUTH=CRAM-MD5";
- else bincClient << " AUTH=LOGIN AUTH=PLAIN";
+ if (cram != string::npos)
+ bincClient << " AUTH=LOGIN AUTH=PLAIN AUTH=CRAM-MD5";
+ else
+ bincClient << " AUTH=LOGIN AUTH=PLAIN";
} else
bincClient << " LOGINDISABLED";
}