[dovecot-cvs] dovecot/src/imap cmd-list.c,1.51.2.7,1.51.2.8

tss at dovecot.org tss at dovecot.org
Tue Mar 6 19:43:58 EET 2007


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv13354

Modified Files:
      Tag: branch_1_0
	cmd-list.c 
Log Message:
With namespace prefixes LSUB prefix.* listed INBOX.INBOX.



Index: cmd-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-list.c,v
retrieving revision 1.51.2.7
retrieving revision 1.51.2.8
diff -u -d -r1.51.2.7 -r1.51.2.8
--- cmd-list.c	23 Feb 2007 18:29:32 -0000	1.51.2.7
+++ cmd-list.c	6 Mar 2007 17:43:54 -0000	1.51.2.8
@@ -123,11 +123,21 @@
 	name_str = t_str_new(256);
 	while ((list = mail_storage_mailbox_list_next(ctx->list_ctx)) != NULL) {
 		str_truncate(name_str, 0);
-		/* when listing INBOX from inbox=yes namespace, don't insert
-		   the namespace prefix (note however that LIST prefix.% may
-		   return INBOX if it has children) */
-		if (!ctx->match_inbox || strcasecmp(list->name, "INBOX") != 0)
+		if (ctx->ns->inbox && strcasecmp(list->name, "INBOX") == 0) {
+			/* Listing INBOX from inbox=yes namespace.
+			   Don't insert the namespace prefix. */
+			if (!ctx->match_inbox) {
+				/* The mask doesn't match INBOX (eg. prefix.%).
+				   We still want to list prefix.INBOX if it has
+				   children. Otherwise we don't want to list
+				   this INBOX at all. */
+				if ((list->flags & MAILBOX_CHILDREN) == 0)
+					continue;
+				str_append(name_str, ctx->ns->prefix);
+			}
+		} else {
 			str_append(name_str, ctx->ns->prefix);
+		}
 		str_append(name_str, list->name);
 
 		if (ctx->ns->sep != ctx->ns->real_sep) {



More information about the dovecot-cvs mailing list