diff options
author | redneckcatholic <redneckcatholic@users.noreply.github.com> | 2022-11-23 00:02:18 -0500 |
---|---|---|
committer | redneckcatholic <redneckcatholic@users.noreply.github.com> | 2022-11-23 01:22:12 -0500 |
commit | d39734bf3fd84c568c15e90d6edb75e68d74b3e1 (patch) | |
tree | bf1820828f450977151bf6dd4cfd12af87a4026c /activitypub.js | |
parent | e93b23db71df18480b29ed53c1b8247e7f0f83a7 (diff) |
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
Diffstat (limited to 'activitypub.js')
-rw-r--r-- | activitypub.js | 5 |
1 files changed, 4 insertions, 1 deletions
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 = []; |