From 552adc864ab668b672e9defd788f71c861f00883 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 4 Sep 2019 13:52:10 +0300 Subject: [PATCH] push-notification-lua: Use the new accessor functions instead of variables directly 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/push-notification/push-notification-driver-lua.c b/src/plugins/push-notification/push-notification-driver-lua.c index c4e65ff3d3..68d2b1e4de 100644 --- a/src/plugins/push-notification/push-notification-driver-lua.c +++ b/src/plugins/push-notification/push-notification-driver-lua.c @@ -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)) -- 2.47.3