feat: on post delete, federate out an Update(Tombstone)

This commit is contained in:
Julian Lam
2024-05-07 12:37:57 -04:00
parent 51089a347a
commit 96db519b79
2 changed files with 6 additions and 1 deletions

View File

@@ -193,7 +193,7 @@ activitypubApi.update.note = enabledCheck(async (caller, { post }) => {
}
const payload = {
id: `${object.id}#activity/update/${post.edited}`,
id: `${object.id}#activity/update/${post.edited || Date.now()}`,
type: 'Update',
to: object.to,
cc: object.cc,

View File

@@ -193,6 +193,11 @@ async function deleteOrRestore(caller, data, params) {
tid: postData.tid,
ip: caller.ip,
});
// Explicitly non-awaited
posts.getPostSummaryByPids([data.pid], caller.uid, {}).then(([post]) => {
require('.').activitypub.update.note(caller, { post });
});
}
async function deleteOrRestoreTopicOf(command, pid, caller) {