Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5221:c8a82d0fb443 HEAD
With namespace prefixes LSUB prefix.* listed INBOX.INBOX.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 06 Mar 2007 19:43:59 +0200 |
parents | 7fbdcce95982 |
children | 685a2d213438 |
files | src/imap/cmd-list.c |
diffstat | 1 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/imap/cmd-list.c Tue Mar 06 18:57:35 2007 +0200 +++ b/src/imap/cmd-list.c Tue Mar 06 19:43:59 2007 +0200 @@ -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) {