[dovecot-cvs] dovecot/src/imap cmd-list.c,1.62,1.63

tss at dovecot.org tss at dovecot.org
Tue Mar 6 19:44:01 EET 2007


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

Modified Files:
	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.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- cmd-list.c	23 Feb 2007 18:29:36 -0000	1.62
+++ cmd-list.c	6 Mar 2007 17:43:59 -0000	1.63
@@ -116,11 +116,21 @@
 	name_str = t_str_new(256);
 	while ((info = mailbox_list_iter_next(ctx->list_iter)) != 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(info->name, "INBOX") != 0)
+		if (ctx->ns->inbox && strcasecmp(info->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 ((info->flags & MAILBOX_CHILDREN) == 0)
+					continue;
+				str_append(name_str, ctx->ns->prefix);
+			}
+		} else {
 			str_append(name_str, ctx->ns->prefix);
+		}
 		str_append(name_str, info->name);
 
 		if (ctx->ns->sep != ctx->ns->real_sep) {



More information about the dovecot-cvs mailing list