]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-acl: Add imap_acl_storage with module context
authorMarkus Valentin <markus.valentin@open-xchange.com>
Thu, 20 May 2021 21:21:10 +0000 (23:21 +0200)
committermarkus.valentin <markus.valentin@open-xchange.com>
Wed, 26 May 2021 10:15:09 +0000 (10:15 +0000)
src/plugins/imap-acl/imap-acl-plugin.c
src/plugins/imap-acl/imap-acl-plugin.h

index df3608b494ef6472247e7e174e733b6664d4f408..b86f8ac5d9d7294aa54fe90b1d3a9f1d49173865 100644 (file)
@@ -7,6 +7,8 @@
 #include "imap-commands.h"
 #include "mail-storage.h"
 #include "mail-namespace.h"
+#include "mail-storage-private.h"
+#include "module-context.h"
 #include "acl-api.h"
 #include "acl-storage.h"
 #include "acl-plugin.h"
 #define IMAP_ACL_GROUP_OVERRIDE_PREFIX "!$"
 #define IMAP_ACL_GLOBAL_PREFIX "#"
 
+#define IMAP_ACL_CONTEXT(obj) \
+       MODULE_CONTEXT(obj, imap_acl_storage_module)
+#define IMAP_ACL_CONTEXT_REQUIRE(obj) \
+       MODULE_CONTEXT_REQUIRE(obj, imap_acl_storage_module)
+
 struct imap_acl_letter_map {
        char letter;
        const char *name;
@@ -43,6 +50,14 @@ static const struct imap_acl_letter_map imap_acl_letter_map[] = {
        { '\0', NULL }
 };
 
+struct imap_acl_storage {
+       union mail_storage_module_context module_ctx;
+       struct imapc_acl_context *iacl_ctx;
+};
+
+struct imap_acl_storage_module imap_acl_storage_module =
+       MODULE_CONTEXT_INIT(&mail_storage_module_register);
+
 const char *imap_acl_plugin_version = DOVECOT_ABI_VERSION;
 
 static struct module *imap_acl_module;
index b15478a495b1352ec51e4c998c1d945cd93bda15..117e8fbca474de61f6f267fe4d172e0e196bebf7 100644 (file)
@@ -4,6 +4,8 @@
 extern const char *imap_acl_plugin_dependencies[];
 extern const char imap_acl_plugin_binary_dependency[];
 
+extern MODULE_CONTEXT_DEFINE(imap_acl_storage_module, &mail_storage_module_register);
+
 void imap_acl_plugin_init(struct module *module);
 void imap_acl_plugin_deinit(void);