mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-19 02:50:53 +01:00
fix: author of boosted content was not targeted in the activity
This commit is contained in:
@@ -313,7 +313,7 @@ Out.announce.topic = enabledCheck(async (tid) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uid = await posts.getPostField(pid, 'uid'); // author
|
const authorUid = await posts.getPostField(pid, 'uid'); // author
|
||||||
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) {
|
||||||
activitypub.helpers.log(`[activitypub/api] Not federating announce of pid ${pid} to the fediverse due to privileges.`);
|
activitypub.helpers.log(`[activitypub/api] Not federating announce of pid ${pid} to the fediverse due to privileges.`);
|
||||||
@@ -323,8 +323,9 @@ Out.announce.topic = enabledCheck(async (tid) => {
|
|||||||
const { to, cc, targets } = await activitypub.buildRecipients({
|
const { to, cc, targets } = await activitypub.buildRecipients({
|
||||||
id: pid,
|
id: pid,
|
||||||
to: [activitypub._constants.publicAddress],
|
to: [activitypub._constants.publicAddress],
|
||||||
cc: [`${nconf.get('url')}/category/${cid}/followers`, uid],
|
cc: [authorUid],
|
||||||
}, { cid, uid: utils.isNumber(uid) ? uid : undefined });
|
}, { cid });
|
||||||
|
targets.add(authorUid);
|
||||||
|
|
||||||
await activitypub.send('cid', cid, Array.from(targets), {
|
await activitypub.send('cid', cid, Array.from(targets), {
|
||||||
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/cid/${cid}`,
|
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/cid/${cid}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user