]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fixed listing subscriptions from prefix!="" namespace
authorTimo Sirainen <tss@iki.fi>
Wed, 16 Nov 2011 18:00:37 +0000 (20:00 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 16 Nov 2011 18:00:37 +0000 (20:00 +0200)
src/lib-storage/list/mailbox-list-subscriptions.c

index b40bdb2d19893d1839c899798dc12ca3bfdfa591..08733d6a016ee8ad3fbbc308840af41530762052 100644 (file)
@@ -224,7 +224,10 @@ mailbox_list_subscriptions_iter_init(struct mailbox_list *list,
        mailbox_list_subscriptions_fill(&ctx->ctx, ctx->tree);
 
        ctx->info.ns = list->ns;
-       ctx->iter = mailbox_tree_iterate_init(ctx->tree, NULL, 0);
+       /* the tree usually has only those entries we want to iterate through,
+          but there are also non-matching root entries (e.g. "LSUB foo/%" will
+          include the "foo"), which we'll drop with MAILBOX_MATCHED. */
+       ctx->iter = mailbox_tree_iterate_init(ctx->tree, NULL, MAILBOX_MATCHED);
        return &ctx->ctx;
 }