mailbox-list-index-iter.c revision 34b724d1d7e50b1ab24267a3b6fc089b1147c1ab
/* Copyright (c) 2006-2017 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "imap-match.h"
#include "mail-storage.h"
#include "mailbox-list-subscriptions.h"
#include "mailbox-list-index.h"
{
/* for now we don't use indexes when listing subscriptions,
because it needs to list also the nonexistent subscribed
mailboxes, which don't exist in the index. */
return FALSE;
}
/* no indexing wanted with raw lists */
return FALSE;
}
/* refresh failed */
return FALSE;
}
return TRUE;
}
struct mailbox_list_iterate_context *
const char *const *patterns,
enum mailbox_list_iter_flags flags)
{
struct mailbox_list_index_iterate_context *ctx;
if (!iter_use_index(ctx)) {
/* no indexing */
} else {
/* listing mailboxes from index */
}
}
static void
{
/* the root directory may have an empty name. in that case we'll still
want to insert the separator, so check for non-NULL parent rather
than non-empty path. */
}
MAILBOX_LIST_ITER_RETURN_SUBSCRIBED)) != 0) {
}
mailbox_free(&box);
}
}
static void
bool follow_children)
{
} else {
ctx->parent_len--;
}
/* last one */
return;
}
}
}
}
static bool
{
return TRUE;
return TRUE;
return TRUE;
return FALSE;
}
const struct mailbox_info *
{
struct mailbox_list_index_iterate_context *ctx =
(struct mailbox_list_index_iterate_context *)_ctx;
bool follow_children;
enum imap_match_result match;
/* index isn't being used */
}
/* listing mailboxes from index */
IMAP_MATCH_CHILDREN)) != 0;
/* listing only subscriptions, but there are no
subscribed children. */
}
}
return mailbox_list_iter_default_next(_ctx);
}
{
struct mailbox_list_index_iterate_context *ctx =
(struct mailbox_list_index_iterate_context *)_ctx;
else
return ret;
}