Mercurial > dovecot > core-2.2
changeset 12654:87a75628c8f5
lib-storage: Mailbox list indexes are now enabled also for in-memory indexes.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 12 Feb 2011 00:38:09 +0200 |
parents | e2605d2d6b33 |
children | 28f43332ba12 |
files | src/lib-storage/list/index-mailbox-list.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/list/index-mailbox-list.c Sat Feb 12 00:16:06 2011 +0200 +++ b/src/lib-storage/list/index-mailbox-list.c Sat Feb 12 00:38:09 2011 +0200 @@ -799,13 +799,15 @@ const char *dir; dir = mailbox_list_get_path(list, NULL, MAILBOX_LIST_PATH_TYPE_INDEX); - if (*dir == '\0' || list->mail_set->mailbox_list_index) { + if (list->mail_set->mailbox_list_index) { /* reserve the module context anyway, so syncing code knows that the index is disabled */ ilist = NULL; MODULE_CONTEXT_SET(list, index_mailbox_list_module, ilist); return; } + if (*dir == '\0') + dir = NULL; ilist = p_new(list->pool, struct index_mailbox_list, 1); ilist->module_ctx.super = list->v; @@ -822,8 +824,8 @@ MODULE_CONTEXT_SET(list, index_mailbox_list_module, ilist); - ilist->path = p_strdup_printf(list->pool, - "%s/"MAILBOX_LIST_INDEX_PREFIX, dir); + ilist->path = dir == NULL ? "(in-memory mailbox list index)" : + p_strdup_printf(list->pool, "%s/"MAILBOX_LIST_INDEX_PREFIX, dir); ilist->index = mail_index_alloc(dir, MAILBOX_LIST_INDEX_PREFIX); ilist->ext_id = mail_index_ext_register(ilist->index, "list",