From 74b6336fe5ae7290f659bc3dac88c9dc037c29e4 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Tue, 25 Sep 2018 14:08:59 +0300 Subject: [PATCH] push-notification-driver-lua: Move event push earlier Simplifies code --- 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 418b21d097..ae21a1fb03 100644 --- a/src/plugins/push-notification/push-notification-driver-lua.c +++ b/src/plugins/push-notification/push-notification-driver-lua.c @@ -365,8 +365,9 @@ push_notification_driver_lua_call(struct dlua_push_notification_context *ctx, lua_rawgeti(ctx->script->L, LUA_REGISTRYINDEX, tctx->tx_ref); /* push event + common fields */ + push_notification_driver_lua_pushevent(event, ctx); + if (mbox != NULL) { - push_notification_driver_lua_pushevent(event, ctx); lua_pushstring(ctx->script->L, mbox->mailbox); lua_setfield(ctx->script->L, -2, "mailbox"); push_notification_driver_debug(DLUA_LOG_LABEL, user, @@ -374,7 +375,6 @@ push_notification_driver_lua_call(struct dlua_push_notification_context *ctx, fn, event->event->event->name, mbox->mailbox); } else if (msg != NULL) { - push_notification_driver_lua_pushevent(event, ctx); lua_pushstring(ctx->script->L, msg->mailbox); lua_setfield(ctx->script->L, -2, "mailbox"); lua_pushnumber(ctx->script->L, msg->uid); -- 2.47.3