mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
feat: extend activitypubApi.create.note to accept a post object to reduce unnecessary calls to retrieve post summary
This commit is contained in:
@@ -144,10 +144,12 @@ async function buildRecipients(object, { pid, uid }) {
|
||||
};
|
||||
}
|
||||
|
||||
activitypubApi.create.note = enabledCheck(async (caller, { pid }) => {
|
||||
const post = (await posts.getPostSummaryByPids([pid], caller.uid, { stripTags: false })).pop();
|
||||
activitypubApi.create.note = enabledCheck(async (caller, { pid, post }) => {
|
||||
if (!post) {
|
||||
return;
|
||||
post = (await posts.getPostSummaryByPids([pid], caller.uid, { stripTags: false })).pop();
|
||||
if (!post) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const allowed = await privileges.posts.can('topics:read', pid, activitypub._constants.uid);
|
||||
|
||||
Reference in New Issue
Block a user