fix: minor cleanup

This commit is contained in:
Julian Lam
2024-05-10 17:00:27 -04:00
parent 1fa9346563
commit 129017f735

View File

@@ -225,9 +225,7 @@ activitypubApi.delete.note = enabledCheck(async (caller, { pid }) => {
const id = `${nconf.get('url')}/post/${pid}`; const id = `${nconf.get('url')}/post/${pid}`;
const post = (await posts.getPostSummaryByPids([pid], caller.uid, { stripTags: false })).pop(); const post = (await posts.getPostSummaryByPids([pid], caller.uid, { stripTags: false })).pop();
const object = await activitypub.mocks.note(post); const object = await activitypub.mocks.note(post);
const { tid, uid } = await posts.getPostFields(pid, ['tid', 'uid']); const { to, cc, targets } = await buildRecipients(object, { pid, uid: post.user.uid });
const origin = `${nconf.get('url')}/topic/${tid}`;
const { to, cc, targets } = await buildRecipients(object, { pid, uid });
const allowed = await privileges.posts.can('topics:read', pid, activitypub._constants.uid); const allowed = await privileges.posts.can('topics:read', pid, activitypub._constants.uid);
if (!allowed) { if (!allowed) {
@@ -241,7 +239,7 @@ activitypubApi.delete.note = enabledCheck(async (caller, { pid }) => {
to, to,
cc, cc,
object: id, object: id,
origin, origin: object.context,
}; };
await activitypub.send('uid', caller.uid, Array.from(targets), payload); await activitypub.send('uid', caller.uid, Array.from(targets), payload);