dovecot-2.2: layout=index: Fixed listing subscriptions.

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 18 18:50:14 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/2da229987a81
changeset: 16299:2da229987a81
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 18 18:49:55 2013 +0300
description:
layout=index: Fixed listing subscriptions.

diffstat:

 src/lib-storage/list/mailbox-list-index-backend.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r f0b232b956a6 -r 2da229987a81 src/lib-storage/list/mailbox-list-index-backend.c
--- a/src/lib-storage/list/mailbox-list-index-backend.c	Thu Apr 18 17:54:29 2013 +0300
+++ b/src/lib-storage/list/mailbox-list-index-backend.c	Thu Apr 18 18:49:55 2013 +0300
@@ -613,12 +613,17 @@
 
 static struct mailbox_list_iterate_context *
 index_list_iter_init(struct mailbox_list *list,
-		     const char *const *patterns ATTR_UNUSED,
+		     const char *const *patterns,
 		     enum mailbox_list_iter_flags flags)
 {
 	struct mailbox_list_iterate_context *ctx;
 	pool_t pool;
 
+	if ((flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0) {
+		return mailbox_list_subscriptions_iter_init(list, patterns,
+							    flags);
+	}
+
 	pool = pool_alloconly_create("mailbox list index backend iter", 1024);
 	ctx = p_new(pool, struct mailbox_list_iterate_context, 1);
 	ctx->pool = pool;
@@ -629,13 +634,17 @@
 }
 
 static const struct mailbox_info *
-index_list_iter_next(struct mailbox_list_iterate_context *ctx ATTR_UNUSED)
+index_list_iter_next(struct mailbox_list_iterate_context *ctx)
 {
+	if ((ctx->flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0)
+		return mailbox_list_subscriptions_iter_next(ctx);
 	return NULL;
 }
 
 static int index_list_iter_deinit(struct mailbox_list_iterate_context *ctx)
 {
+	if ((ctx->flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0)
+		return mailbox_list_subscriptions_iter_deinit(ctx);
 	pool_unref(&ctx->pool);
 	return 0;
 }


More information about the dovecot-cvs mailing list