Mercurial > dovecot > core-2.2
changeset 11573:3128f592ef5c HEAD
lib-storage: Fixed getting flags for subscribed mailboxes with non-default namespace settings.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 17 Jun 2010 19:50:44 +0100 |
parents | 659bb1a26da4 |
children | 7330bb240c75 |
files | src/lib-storage/list/mailbox-list-fs-iter.c |
diffstat | 1 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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,