From 44388ac49531af9e2565f76ef99ff7afb757b3fb Mon Sep 17 00:00:00 2001 From: Erwin Hoffmann Date: Thu, 21 Sep 2023 17:36:16 +0200 Subject: all sources --- src/maildir-select.cc | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/maildir-select.cc (limited to 'src/maildir-select.cc') diff --git a/src/maildir-select.cc b/src/maildir-select.cc new file mode 100644 index 0000000..78daf9d --- /dev/null +++ b/src/maildir-select.cc @@ -0,0 +1,45 @@ +/** -------------------------------------------------------------------- + * @file maildir-select.cc + * @brief Implementation of the Maildir class. + * @author Andreas Aardal Hanssen + * @date Andreas Aardal Hanssen + * ----------------------------------------------------------------- **/ +#include "maildir.h" + +#include +#include + +using namespace ::std; +using namespace Binc; + +//------------------------------------------------------------------------ +bool Binc::Maildir::selectMailbox(const std::string &name, + const std::string &s_in) +{ + setName(name); + + if (selected) { + closeMailbox(); + selected = false; + } + + oldrecent = 0; + oldexists = 0; + + mailboxchanged = false; + + setPath(s_in); + + switch (scan()) { + case Success: + break; + case TemporaryError: + if (scan() == Success) + break; + case PermanentError: + return false; + } + + selected = true; + return true; +} -- cgit v1.2.3