fts-lucene-plugin.c (dovecot-2.3.16) | : | fts-lucene-plugin.c (dovecot-2.3.17) | ||
---|---|---|---|---|
skipping to change at line 99 | skipping to change at line 99 | |||
crc = crc32_str_more(crc, "s"); | crc = crc32_str_more(crc, "s"); | |||
/* don't include mime_parts here, since changing it doesn't | /* don't include mime_parts here, since changing it doesn't | |||
necessarily need the index to be rebuilt */ | necessarily need the index to be rebuilt */ | |||
return crc; | return crc; | |||
} | } | |||
static void fts_lucene_mail_user_deinit(struct mail_user *user) | static void fts_lucene_mail_user_deinit(struct mail_user *user) | |||
{ | { | |||
struct fts_lucene_user *fuser = FTS_LUCENE_USER_CONTEXT_REQUIRE(user); | struct fts_lucene_user *fuser = FTS_LUCENE_USER_CONTEXT_REQUIRE(user); | |||
if (fuser->set.use_libfts) | fts_mail_user_deinit(user); | |||
fts_mail_user_deinit(user); | ||||
fuser->module_ctx.super.deinit(user); | fuser->module_ctx.super.deinit(user); | |||
} | } | |||
static void fts_lucene_mail_user_created(struct mail_user *user) | static void fts_lucene_mail_user_created(struct mail_user *user) | |||
{ | { | |||
struct mail_user_vfuncs *v = user->vlast; | struct mail_user_vfuncs *v = user->vlast; | |||
struct fts_lucene_user *fuser; | struct fts_lucene_user *fuser; | |||
const char *env, *error; | const char *env, *error; | |||
fuser = p_new(user->pool, struct fts_lucene_user, 1); | fuser = p_new(user->pool, struct fts_lucene_user, 1); | |||
env = mail_user_plugin_getenv(user, "fts_lucene"); | env = mail_user_plugin_getenv(user, "fts_lucene"); | |||
if (env == NULL) | if (env == NULL) | |||
env = ""; | env = ""; | |||
if (fts_lucene_plugin_init_settings(user, &fuser->set, env) < 0) { | if (fts_lucene_plugin_init_settings(user, &fuser->set, env) < 0) { | |||
/* invalid settings, disabling */ | /* invalid settings, disabling */ | |||
return; | return; | |||
} | } | |||
if (fuser->set.use_libfts) { | if (fts_mail_user_init(user, fuser->set.use_libfts, &error) < 0) { | |||
if (fts_mail_user_init(user, &error) < 0) { | i_error("fts_lucene: %s", error); | |||
i_error("fts_lucene: %s", error); | return; | |||
return; | ||||
} | ||||
} | } | |||
fuser->module_ctx.super = *v; | fuser->module_ctx.super = *v; | |||
user->vlast = &fuser->module_ctx.super; | user->vlast = &fuser->module_ctx.super; | |||
v->deinit = fts_lucene_mail_user_deinit; | v->deinit = fts_lucene_mail_user_deinit; | |||
MODULE_CONTEXT_SET(user, fts_lucene_user_module, fuser); | MODULE_CONTEXT_SET(user, fts_lucene_user_module, fuser); | |||
} | } | |||
static struct mail_storage_hooks fts_lucene_mail_storage_hooks = { | static struct mail_storage_hooks fts_lucene_mail_storage_hooks = { | |||
.mail_user_created = fts_lucene_mail_user_created | .mail_user_created = fts_lucene_mail_user_created | |||
End of changes. 2 change blocks. | ||||
7 lines changed or deleted | 4 lines changed or added |