]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add metacache_service_user_module
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 12 Nov 2024 20:39:53 +0000 (22:39 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:40:00 +0000 (10:40 +0200)
This is a bit of a kludge to keep it in core, but it is wanted independently
by both obox and fts_dovecot plugins.

src/lib-storage/mail-storage-service.c
src/lib-storage/mail-storage-service.h

index 2bf2356c4587a9cab3433d8028d833a6aa629ffd..779d9a36958ca167070b1c456b419a1331fc1806 100644 (file)
@@ -64,6 +64,9 @@ struct mail_storage_service_user_module_register
        mail_storage_service_user_module_register = { 0 };
 struct module *mail_storage_service_modules = NULL;
 
+struct metacache_service_user_module metacache_service_user_module =
+       MODULE_CONTEXT_INIT(&mail_storage_service_user_module_register);
+
 static void set_keyvalue(struct mail_storage_service_user *user,
                         const char *key, const char *value)
 {
index 07f3b901d6de5410214f0e668cef9754742752db..4bb5eab1ace1c9afb8706d6cffc6bdccf64a4740 100644 (file)
@@ -2,6 +2,7 @@
 #define MAIL_STORAGE_SERVICE_H
 
 #include "net.h"
+#include "module-context.h"
 
 struct master_service;
 struct ssl_iostream_settings;
@@ -128,6 +129,11 @@ extern struct mail_storage_service_user_module_register
        mail_storage_service_user_module_register;
 extern struct module *mail_storage_service_modules;
 
+/* Stored here, since it's used by both obox and fts_dovecot plugins.
+   It's better not to have to link fts_dovecot with obox plugin. */
+extern MODULE_CONTEXT_DEFINE(metacache_service_user_module,
+                            &mail_storage_service_user_module_register);
+
 struct mail_storage_service_ctx *
 mail_storage_service_init(struct master_service *service,
                          enum mail_storage_service_flags flags);