dovecot-2.0: lib-storage: Fixed getting flags for subscribed mai...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jun 17 21:50:47 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/3128f592ef5c
changeset: 11573:3128f592ef5c
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jun 17 19:50:44 2010 +0100
description:
lib-storage: Fixed getting flags for subscribed mailboxes with non-default namespace settings.

diffstat:

 src/lib-storage/list/mailbox-list-fs-iter.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (34 lines):

diff -r 659bb1a26da4 -r 3128f592ef5c src/lib-storage/list/mailbox-list-fs-iter.c
--- a/src/lib-storage/list/mailbox-list-fs-iter.c	Thu Jun 17 19:18:34 2010 +0100
+++ b/src/lib-storage/list/mailbox-list-fs-iter.c	Thu Jun 17 19:50:44 2010 +0100
@@ -622,7 +622,7 @@
 {
 	struct mailbox_node *node;
 	enum mailbox_info_flags flags;
-	const char *path, *dir, *fname, *name;
+	const char *path, *dir, *fname, *storage_name;
 	unsigned int len;
 	struct stat st;
 
@@ -639,13 +639,16 @@
 		return &ctx->info;
 	}
 
+	storage_name = (ctx->ctx.flags & MAILBOX_LIST_ITER_VIRTUAL_NAMES) == 0 ?
+		ctx->info.name :
+		mail_namespace_get_storage_name(ctx->info.ns, ctx->info.name);
+
 	/* if name ends with hierarchy separator, drop the separator */
-	name = ctx->info.name;
-	len = strlen(name);
-	if (len > 0 && name[len-1] == ctx->info.ns->real_sep)
-		name = t_strndup(name, len-1);
+	len = strlen(storage_name);
+	if (len > 0 && storage_name[len-1] == ctx->info.ns->real_sep)
+		storage_name = t_strndup(storage_name, len-1);
 
-	path = mailbox_list_get_path(ctx->ctx.list, name,
+	path = mailbox_list_get_path(ctx->ctx.list, storage_name,
 				     MAILBOX_LIST_PATH_TYPE_DIR);
 	path_split(path, &dir, &fname);
 	if (ctx->ctx.list->v.get_mailbox_flags(ctx->ctx.list, dir, fname,


More information about the dovecot-cvs mailing list