From: Aki Tuomi Date: Tue, 25 Sep 2018 11:08:59 +0000 (+0300) Subject: push-notification-driver-lua: Move event push earlier X-Git-Tag: 2.3.4~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74b6336fe5ae7290f659bc3dac88c9dc037c29e4;p=thirdparty%2Fdovecot%2Fcore.git push-notification-driver-lua: Move event push earlier Simplifies code --- 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);