[dovecot-cvs] dovecot/src/imap cmd-list.c,1.29,1.30

cras at procontrol.fi cras at procontrol.fi
Sat Sep 6 21:29:54 EEST 2003


Update of /home/cvs/dovecot/src/imap
In directory danu:/tmp/cvs-serv20912

Modified Files:
	cmd-list.c 
Log Message:
If LISTEXT is used and CHILDREN info isn't wanted, don't send it.



Index: cmd-list.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-list.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- cmd-list.c	27 Jul 2003 05:52:01 -0000	1.29
+++ cmd-list.c	6 Sep 2003 17:29:52 -0000	1.30
@@ -8,7 +8,14 @@
 #include "commands.h"
 #include "namespace.h"
 
-static const char *mailbox_flags2str(enum mailbox_flags flags, int listext)
+enum imap_list_flags {
+	IMAP_LIST_FLAG_EXT	= 0x01,
+	IMAP_LIST_FLAG_CHILDREN
+};
+
+static const char *
+mailbox_flags2str(enum mailbox_flags flags, enum mailbox_list_flags list_flags,
+		  int listext)
 {
 	const char *str;
 
@@ -22,6 +29,11 @@
 	if ((flags & MAILBOX_NONEXISTENT) != 0 && !listext)
 		flags |= MAILBOX_NOSELECT;
 
+	if (listext && (list_flags & MAILBOX_LIST_CHILDREN) == 0) {
+		/* LISTEXT used and we didn't want children info */
+		flags &= ~(MAILBOX_CHILDREN|MAILBOX_NOCHILDREN);
+	}
+
 	str = t_strconcat((flags & MAILBOX_NOSELECT) ? " \\Noselect" : "",
 			  (flags & MAILBOX_NONEXISTENT) ? " \\NonExistent" : "",
 			  (flags & MAILBOX_PLACEHOLDER) ? " \\PlaceHolder" : "",
@@ -51,7 +63,7 @@
 	while ((list = storage->list_mailbox_next(ctx)) != NULL) {
 		str_truncate(str, 0);
 		str_printfa(str, "* %s (%s) \"%s\" ", reply,
-			    mailbox_flags2str(list->flags, listext),
+			    mailbox_flags2str(list->flags, list_flags, listext),
 			    sep);
 		if (strcasecmp(list->name, "INBOX") == 0)
 			str_append(str, "INBOX");



More information about the dovecot-cvs mailing list