dovecot-2.0: lib-storage: Fixed listing shared INBOX with FS layout

dovecot at dovecot.org dovecot at dovecot.org
Thu Aug 12 19:31:49 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/4d8ae218af73
changeset: 11990:4d8ae218af73
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Aug 12 17:31:46 2010 +0100
description:
lib-storage: Fixed listing shared INBOX with FS layout

diffstat:

 src/lib-storage/list/mailbox-list-fs-iter.c |  21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diffs (42 lines):

diff -r ab8ca4ded5ac -r 4d8ae218af73 src/lib-storage/list/mailbox-list-fs-iter.c
--- a/src/lib-storage/list/mailbox-list-fs-iter.c	Thu Aug 12 16:58:45 2010 +0100
+++ b/src/lib-storage/list/mailbox-list-fs-iter.c	Thu Aug 12 17:31:46 2010 +0100
@@ -407,17 +407,21 @@
 	}
 }
 
-static struct mailbox_info *fs_list_inbox(struct fs_list_iterate_context *ctx)
+static const char *
+fs_list_get_inbox_vname(struct fs_list_iterate_context *ctx)
 {
 	struct mail_namespace *ns = ctx->ctx.list->ns;
 
+	if ((ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0)
+		return "INBOX";
+	else
+		return p_strconcat(ctx->info_pool, ns->prefix, "INBOX", NULL);
+}
+
+static struct mailbox_info *fs_list_inbox(struct fs_list_iterate_context *ctx)
+{
 	ctx->info.flags = 0;
-	if ((ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0)
-		ctx->info.name = "INBOX";
-	else {
-		ctx->info.name = p_strconcat(ctx->info_pool,
-					     ns->prefix, "INBOX", NULL);
-	}
+	ctx->info.name = fs_list_get_inbox_vname(ctx);
 
 	if (mailbox_list_mailbox(ctx->ctx.list, "INBOX", &ctx->info.flags) < 0)
 		ctx->ctx.failed = TRUE;
@@ -799,7 +803,8 @@
 	if (!ctx->inbox_found &&
 	    (ctx->ctx.list->ns->flags & NAMESPACE_FLAG_INBOX_ANY) != 0 &&
 	    ((ctx->glob != NULL &&
-	      imap_match(ctx->glob, "INBOX") == IMAP_MATCH_YES) ||
+	      imap_match(ctx->glob,
+			 fs_list_get_inbox_vname(ctx)) == IMAP_MATCH_YES) ||
 	     ctx->inbox_match)) {
 		/* INBOX wasn't seen while listing other mailboxes. It might
 		   be located elsewhere. */


More information about the dovecot-cvs mailing list