]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
push-notification: Don't send event on failure
authorAki Tuomi <aki.tuomi@open-xchange.com>
Sun, 2 Feb 2020 18:40:32 +0000 (20:40 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 6 Feb 2020 12:18:41 +0000 (12:18 +0000)
If transaction was rolled back, don't send event.

src/plugins/push-notification/push-notification-plugin.c

index f99ce43c2f267a6923583ee9686971c12394bf1c..878809dac8ed443fa7641cf6f6377779236a6b67 100644 (file)
@@ -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);
 }