imapc-list.c revision 0b25846ba794ce19536a24d4065beaf2a0bd9464
/* Copyright (c) 2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "imap-arg.h"
#include "imap-match.h"
#include "mailbox-tree.h"
#include "mailbox-list-subscriptions.h"
#include "imapc-client.h"
#include "imapc-storage.h"
#include "imapc-list.h"
struct imapc_mailbox_list_iterate_context {
struct mailbox_list_iterate_context ctx;
struct mailbox_tree_context *tree;
struct mailbox_tree_iterate_context *iter;
struct mailbox_info info;
};
extern struct mailbox_list imapc_mailbox_list;
static struct mailbox_list *imapc_list_alloc(void)
{
struct imapc_mailbox_list *list;
}
{
}
void *context)
{
const char *str;
enum mail_error error;
}
}
static struct mailbox_node *
{
struct mailbox_node *node;
enum mailbox_info_flags info_flags = 0;
bool created;
return NULL;
flags++;
}
if ((info_flags & MAILBOX_NONEXISTENT) != 0)
else
return node;
}
struct imapc_storage *storage)
{
/* we haven't asked for the separator yet.
lets see if this is the reply for its request. */
return;
/* we can't handle NIL separator yet */
} else {
}
}
struct imapc_storage *storage)
{
struct mailbox_node *node;
/* we haven't asked for the separator yet */
return;
}
}
{
}
static bool
const char *pattern ATTR_UNUSED)
{
return TRUE;
}
static bool
const char *name ATTR_UNUSED)
{
return TRUE;
}
static bool
const char *name ATTR_UNUSED)
{
return TRUE;
}
{
struct imapc_simple_context ctx;
"LIST \"\" \"\"");
return '/';
}
}
}
{
struct mailbox_list_settings list_set;
/* indexes disabled */
/* the root dir shouldn't actually ever be used. we just need
it to be different from index_dir so the index directories
get autocreated */
i_error("imapc: Couldn't create %s mailbox list: %s",
}
}
return list->index_list;
}
static const char *
{
const char *vname;
return name;
}
static const char *
enum mailbox_list_path_type type)
{
const char *fs_name;
} else {
if (type == MAILBOX_LIST_PATH_TYPE_INDEX)
return "";
return NULL;
}
}
static const char *
{
return global ?
} else {
i_panic("imapc: Can't return a temp prefix for '%s'",
return NULL;
}
}
static const char *
{
}
{
struct imapc_simple_context ctx;
if (list->refreshed_mailboxes)
return 0;
}
static void
{
struct imapc_mailbox_list *list =
struct mailbox_tree_iterate_context *iter;
struct mailbox_node *node;
const char *name;
}
}
static struct mailbox_list_iterate_context *
enum mailbox_list_iter_flags flags)
{
struct mailbox_list_iterate_context *_ctx;
struct imapc_mailbox_list_iterate_context *ctx;
char sep;
int ret = 0;
if ((flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) == 0 ||
(flags & MAILBOX_LIST_ITER_RETURN_NO_FLAGS) == 0)
list->iter_count++;
if ((flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0) {
/* we're listing only subscriptions. just use the cached
subscriptions list. */
flags);
if (ret < 0)
return _ctx;
}
if (ret < 0)
}
static const struct mailbox_info *
{
struct imapc_mailbox_list_iterate_context *ctx =
(struct imapc_mailbox_list_iterate_context *)_ctx;
struct mailbox_node *node;
const char *name;
return NULL;
return mailbox_list_subscriptions_iter_next(_ctx);
return NULL;
}
{
struct imapc_mailbox_list_iterate_context *ctx =
(struct imapc_mailbox_list_iterate_context *)_ctx;
struct imapc_mailbox_list *list =
if (--list->iter_count == 0) {
}
return ret;
}
static int
struct mailbox_list *dest_list)
{
struct imapc_mailbox_list *src_list =
(struct imapc_mailbox_list *)_src_list;
struct imapc_simple_context ctx;
return 0;
"LSUB \"\" *");
/* replace subscriptions tree in destination */
return 0;
}
{
struct imapc_simple_context ctx;
}
static int
const char *name ATTR_UNUSED,
{
/* this gets called just before mailbox.create().
we don't need to do anything. */
return 0;
}
static int
{
struct imapc_simple_context ctx;
}
static int
{
}
return 0;
}
static int
const char *name ATTR_UNUSED)
{
return -1;
}
static int
bool rename_children)
{
struct imapc_simple_context ctx;
if (!rename_children) {
"Renaming without children not supported.");
return -1;
}
"Can't rename mailboxes across storages.");
return -1;
}
}
}
struct mailbox_list imapc_mailbox_list = {
{
NULL,
NULL,
NULL,
}
};