[dovecot-cvs] dovecot/src/imap cmd-list.c,1.60,1.61

tss at dovecot.org tss at dovecot.org
Mon Feb 5 14:15:58 UTC 2007


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

Modified Files:
	cmd-list.c 
Log Message:
If namespace has a prefix and inbox=no, don't list prefix.inbox if it
happens to exist when listing for %.



Index: cmd-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-list.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- cmd-list.c	20 Dec 2006 19:23:46 -0000	1.60
+++ cmd-list.c	5 Feb 2007 14:15:56 -0000	1.61
@@ -220,6 +220,7 @@
 	const char *cur_ns_prefix, *cur_ref, *cur_mask;
 	enum imap_match_result match;
 	enum imap_match_result inbox_match;
+	enum mailbox_list_flags list_flags;
 	struct mailbox_list *list;
 	struct imap_match_glob *inbox_glob;
 	unsigned int count;
@@ -269,7 +270,8 @@
 	inbox_glob = imap_match_init(cmd->pool,
 				     t_strconcat(ctx->ref, ctx->mask, NULL),
 				     TRUE, ns->sep);
-	inbox_match = imap_match(inbox_glob, "INBOX");
+	inbox_match = *ns->prefix == '\0' || ns->inbox ?
+		imap_match(inbox_glob, "INBOX") : FALSE;
 	ctx->match_inbox = inbox_match == IMAP_MATCH_YES;
 
 	ctx->glob = imap_match_init(cmd->pool, ctx->mask,
@@ -377,10 +379,13 @@
 	cur_ref = namespace_fix_sep(ns, cur_ref);
 	cur_mask = namespace_fix_sep(ns, cur_mask);
 
+	list_flags = ctx->list_flags;
+	if (ctx->match_inbox)
+		list_flags |= MAILBOX_LIST_FLAG_INBOX;
+
 	list = mail_storage_get_list(ns->storage);
 	cur_mask = mailbox_list_join_refmask(list, cur_ref, cur_mask);
-	ctx->list_iter = mailbox_list_iter_init(list, cur_mask,
-						ctx->list_flags);
+	ctx->list_iter = mailbox_list_iter_init(list, cur_mask, list_flags);
 }
 
 static bool cmd_list_continue(struct client_command_context *cmd)



More information about the dovecot-cvs mailing list