mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: minor cleanup
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user