summaryrefslogtreecommitdiff
path: root/src/maildir-select.cc
diff options
context:
space:
mode:
authorErwin Hoffmann <feh@fehcom.de>2023-09-21 17:36:16 +0200
committerErwin Hoffmann <feh@fehcom.de>2023-09-21 17:36:16 +0200
commit44388ac49531af9e2565f76ef99ff7afb757b3fb (patch)
tree4eeb294db5bc3dbd075d0df5fea13c664cc331e2 /src/maildir-select.cc
parent889d69a87d51c8df531885cf1ac3d12d64a0cff7 (diff)
all sources
Diffstat (limited to 'src/maildir-select.cc')
-rw-r--r--src/maildir-select.cc45
1 files changed, 45 insertions, 0 deletions
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 <fcntl.h>
+#include <unistd.h>
+
+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;
+}