diff src/lib-storage/list/mailbox-list-maildir-iter.c @ 6014:92fabfda82f9 HEAD

Let lib-storage handle matching namespace prefixes as well.
author Timo Sirainen <tss@iki.fi>
date Sun, 15 Jul 2007 09:21:55 +0300
parents ed6c07975ccb
children b6fe8568f207
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-maildir-iter.c	Sun Jul 15 09:20:55 2007 +0300
+++ b/src/lib-storage/list/mailbox-list-maildir-iter.c	Sun Jul 15 09:21:55 2007 +0300
@@ -14,7 +14,7 @@
 	struct mailbox_list_iterate_context ctx;
 	pool_t pool;
 
-	const char *dir, *prefix;
+	const char *dir;
 
         struct mailbox_tree_context *tree_ctx;
 	struct mailbox_tree_iterate_context *tree_iter;
@@ -117,7 +117,9 @@
 
 		/* make sure the pattern matches */
 		str_truncate(mailbox, 0);
-		str_append(mailbox, ctx->prefix);
+		if ((ctx->ctx.list->ns->flags & NAMESPACE_FLAG_INBOX) != 0 &&
+		    strcasecmp(fname + 1, "INBOX") != 0)
+			str_append(mailbox, ctx->ctx.list->ns->prefix);
 		str_append(mailbox, fname + 1);
                 mailbox_c = str_c(mailbox);
 
@@ -221,7 +223,6 @@
 					_list->hierarchy_sep);
 
 	ctx->dir = _list->set.root_dir;
-	ctx->prefix = "";
 
 	if ((flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0) {
 		/* Listing only subscribed mailboxes.