From: Aki Tuomi Date: Mon, 15 Oct 2018 09:03:58 +0000 (+0300) Subject: push-notification: Add event to push notification transaction X-Git-Tag: 2.3.9~1160 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d406d403f626a30428cd77eae6c2d98beb0b1ff;p=thirdparty%2Fdovecot%2Fcore.git push-notification: Add event to push notification transaction --- diff --git a/src/plugins/push-notification/push-notification-drivers.h b/src/plugins/push-notification/push-notification-drivers.h index 0bd4f283c9..26e5f343ce 100644 --- a/src/plugins/push-notification/push-notification-drivers.h +++ b/src/plugins/push-notification/push-notification-drivers.h @@ -95,6 +95,8 @@ struct push_notification_txn { ARRAY(struct push_notification_driver_txn *) drivers; ARRAY(struct push_notification_event_config *) events; + struct event *event; + /* Used with mailbox events. */ struct push_notification_txn_mbox *mbox_txn; diff --git a/src/plugins/push-notification/push-notification-plugin.c b/src/plugins/push-notification/push-notification-plugin.c index e867af2e0d..37ad32d027 100644 --- a/src/plugins/push-notification/push-notification-plugin.c +++ b/src/plugins/push-notification/push-notification-plugin.c @@ -81,7 +81,9 @@ push_notification_transaction_create(struct mailbox *box, ptxn->puser = PUSH_NOTIFICATION_USER_CONTEXT(ptxn->muser); ptxn->t = t; ptxn->trigger = PUSH_NOTIFICATION_EVENT_TRIGGER_NONE; - + ptxn->event = event_create(ptxn->muser->event); + event_add_category(ptxn->event, &event_category_push_notification); + event_set_append_log_prefix(ptxn->event, "push-notification: "); p_array_init(&ptxn->drivers, pool, 4); return ptxn; @@ -100,6 +102,7 @@ static void push_notification_transaction_end } } + event_unref(&ptxn->event); pool_unref(&ptxn->pool); }