changeset 13713:16024d03f66e

lib-storage: Fixed listing subscriptions from prefix!="" namespace
author Timo Sirainen <tss@iki.fi>
date Wed, 16 Nov 2011 20:00:37 +0200
parents 4bdfe947a0b2
children bca3950cad53
files src/lib-storage/list/mailbox-list-subscriptions.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-subscriptions.c	Wed Nov 16 19:48:01 2011 +0200
+++ b/src/lib-storage/list/mailbox-list-subscriptions.c	Wed Nov 16 20:00:37 2011 +0200
@@ -224,7 +224,10 @@
 	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;
 }