changeset 19558:464859d22302

imapc: Don't duplicate standard mailbox flags in LIST replies. We added the standard \NoSelect, \NonExistent, \NoInferiors and \Subscribed to special_use string, which caused them to be sent duplicated.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 14 Jan 2016 16:28:06 +0200
parents 8a084edb4b6d
children 94c83436a1f4
files src/lib-storage/index/imapc/imapc-list.c src/lib-storage/mailbox-list.h
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/imapc/imapc-list.c	Wed Jan 13 14:30:03 2016 +0200
+++ b/src/lib-storage/index/imapc/imapc-list.c	Thu Jan 14 16:28:06 2016 +0200
@@ -660,7 +660,8 @@
 	str_truncate(ctx->special_use, 0);
 
 	for (i = 0; i < N_ELEMENTS(imap_list_flags); i++) {
-		if ((node->flags & imap_list_flags[i].flag) != 0) {
+		if ((node->flags & imap_list_flags[i].flag) != 0 &&
+		    (node->flags & MAILBOX_SPECIALUSE_MASK) != 0) {
 			str_append(ctx->special_use, imap_list_flags[i].str);
 			str_append_c(ctx->special_use, ' ');
 		}
--- a/src/lib-storage/mailbox-list.h	Wed Jan 13 14:30:03 2016 +0200
+++ b/src/lib-storage/mailbox-list.h	Thu Jan 14 16:28:06 2016 +0200
@@ -59,6 +59,7 @@
 	MAILBOX_SPECIALUSE_SENT		= 0x00200000,
 	MAILBOX_SPECIALUSE_TRASH	= 0x00400000,
 	MAILBOX_SPECIALUSE_IMPORTANT	= 0x00800000,
+#define MAILBOX_SPECIALUSE_MASK		  0x00ff0000
 
 	/* Internally used by lib-storage: */
 	MAILBOX_SELECT			= 0x20000000,