]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
push-notification: Emit event on transaction end
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 15 Oct 2018 09:04:19 +0000 (12:04 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 14 Nov 2018 12:14:02 +0000 (14:14 +0200)
src/plugins/push-notification/push-notification-plugin.c

index 37ad32d0278256753929fb558d4de206eb726761..c2b24403176efeb6e7d2237217801af758538ca1 100644 (file)
@@ -20,6 +20,7 @@
 
 #define PUSH_NOTIFICATION_CONFIG "push_notification_driver"
 #define PUSH_NOTIFICATION_CONFIG_OLD "push_notification_backend"
+#define PUSH_NOTIFICATION_EVENT_FINISHED "push_notification_finished"
 
 #define PUSH_NOTIFICATION_USER_CONTEXT(obj) \
         MODULE_CONTEXT_REQUIRE(obj, push_notification_user_module)
@@ -102,6 +103,10 @@ static void push_notification_transaction_end
         }
     }
 
+    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);
 }