From d39734bf3fd84c568c15e90d6edb75e68d74b3e1 Mon Sep 17 00:00:00 2001 From: redneckcatholic Date: Wed, 23 Nov 2022 00:02:18 -0500 Subject: Fix event deletion Append the editToken to the deleteEvent form action to fix the 404 error on event deletion. Refactor broadcastDeleteMessage so that eventDeletion works when federation is disabled. Send deletion emails within the callback, otherwise DB lookup will fail on deleted event id. Fixes #15 --- activitypub.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'activitypub.js') diff --git a/activitypub.js b/activitypub.js index 8620e81..442f03c 100644 --- a/activitypub.js +++ b/activitypub.js @@ -341,8 +341,11 @@ function broadcastUpdateMessage(apObject, followers, eventID) { } function broadcastDeleteMessage(apObject, followers, eventID, callback) { - if (!isFederated) return; callback = callback || function () { }; + if (!isFederated) { + callback([]); + return; + } // we need to build an array of promises for each message we're sending, run Promise.all(), and then that will resolve when every message has been sent (or failed) // per spec, each promise will execute *as it is built*, which is fine, we just need the guarantee that they are all done let promises = []; -- cgit v1.2.3