From: Aki Tuomi Date: Sun, 2 Feb 2020 18:40:32 +0000 (+0200) Subject: push-notification: Don't send event on failure X-Git-Tag: 2.3.10~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6695bce75f33b32256c08908dfedb0e89ea3ebe0;p=thirdparty%2Fdovecot%2Fcore.git push-notification: Don't send event on failure If transaction was rolled back, don't send event. --- diff --git a/src/plugins/push-notification/push-notification-plugin.c b/src/plugins/push-notification/push-notification-plugin.c index f99ce43c2f..878809dac8 100644 --- a/src/plugins/push-notification/push-notification-plugin.c +++ b/src/plugins/push-notification/push-notification-plugin.c @@ -113,10 +113,13 @@ push_notification_transaction_end(struct push_notification_txn *ptxn, } } - struct event_passthrough *e = event_create_passthrough(ptxn->event)-> - set_name(PUSH_NOTIFICATION_EVENT_FINISHED); - /* Emit event */ - e_debug(e->event(), "Push notification transaction completed"); + if (success) { + struct event_passthrough *e = event_create_passthrough(ptxn->event)-> + set_name(PUSH_NOTIFICATION_EVENT_FINISHED); + /* Emit event */ + e_debug(e->event(), "Push notification transaction completed"); + } + event_unref(&ptxn->event); pool_unref(&ptxn->pool); }