]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
push-notification-lua: Use the new accessor functions instead of variables directly
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 4 Sep 2019 10:52:10 +0000 (13:52 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 4 Sep 2019 11:23:17 +0000 (11:23 +0000)
This fixes plugin dependency checking. Instead of:

Fatal: Couldn't load required plugin .../lib22_push_notification_lua_plugin.so: dlopen() failed: /usr/local/lib/dovecot/lib22_push_notification_lua_plugin.so: undefined symbol: event_category_push_notification

The error is now clearer:

Fatal: Couldn't load required plugin .../lib22_push_notification_lua_plugin.so: Plugin push_notification must be loaded also

src/plugins/push-notification/push-notification-driver-lua.c

index c4e65ff3d33f5654a36f50b96b4b228cd7644453..68d2b1e4de0f9516b8e89b890a3c31512447c925 100644 (file)
@@ -75,7 +75,7 @@ push_notification_driver_lua_init(struct push_notification_driver_config *config
        struct dlua_push_notification_context *ctx;
        const char *tmp, *file;
        struct event *event = event_create(user->event);
-       event_add_category(event, &event_category_push_notification);
+       event_add_category(event, push_notification_get_event_category());
        event_set_append_log_prefix(event, "lua: ");
 
        if ((tmp = mail_user_plugin_getenv(user, DLUA_LOG_USERENV_KEY)) == NULL)
@@ -140,7 +140,7 @@ push_notification_driver_lua_init_events(struct push_notification_driver_txn *dt
        bool found_one = FALSE;
 
        /* register *all* events that are present in Lua */
-       array_foreach(&push_notification_events, event) {
+       array_foreach(push_notification_get_events(), event) {
                const char *name = (*event)->name;
                const char *fn = push_notification_driver_lua_to_fn(name);
                if (!dlua_script_has_function(ctx->script, fn))