summaryrefslogtreecommitdiffstats
path: root/src/imap/imap-list.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
commitf7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch)
treea3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /src/imap/imap-list.c
parentInitial commit. (diff)
downloaddovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.tar.xz
dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.zip
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/imap/imap-list.c')
-rw-r--r--src/imap/imap-list.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/imap/imap-list.c b/src/imap/imap-list.c
new file mode 100644
index 0000000..38a81ba
--- /dev/null
+++ b/src/imap/imap-list.c
@@ -0,0 +1,35 @@
+/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
+
+#include "imap-common.h"
+#include "str.h"
+#include "imap-list.h"
+
+bool imap_mailbox_flags2str(string_t *str, enum mailbox_info_flags flags)
+{
+ size_t orig_len = str_len(str);
+
+ if ((flags & MAILBOX_SUBSCRIBED) != 0)
+ str_append(str, "\\Subscribed ");
+
+ if ((flags & MAILBOX_NOSELECT) != 0)
+ str_append(str, "\\Noselect ");
+ if ((flags & MAILBOX_NONEXISTENT) != 0)
+ str_append(str, "\\NonExistent ");
+
+ if ((flags & MAILBOX_CHILDREN) != 0)
+ str_append(str, "\\HasChildren ");
+ else if ((flags & MAILBOX_NOINFERIORS) != 0)
+ str_append(str, "\\NoInferiors ");
+ else if ((flags & MAILBOX_NOCHILDREN) != 0)
+ str_append(str, "\\HasNoChildren ");
+
+ if ((flags & MAILBOX_MARKED) != 0)
+ str_append(str, "\\Marked ");
+ if ((flags & MAILBOX_UNMARKED) != 0)
+ str_append(str, "\\UnMarked ");
+
+ if (str_len(str) == orig_len)
+ return FALSE;
+ str_truncate(str, str_len(str)-1);
+ return TRUE;
+}