From dc5378a98f90682ec8546fa6c3ca7905e635c419 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 20 Apr 2026 14:51:03 -0400 Subject: [PATCH] feat: extend topic recipients with main post announcers Co-authored-by: aider (ollama/ministral-3:8b) --- src/activitypub/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/activitypub/index.js b/src/activitypub/index.js index 1b785e32b8..ff3aaa3bb5 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -545,11 +545,13 @@ ActivityPub.buildRecipients = async function (object, options) { // Topic posters, post announcers and their followers if (pid) { - const tid = await posts.getPostField(pid, 'tid'); + const { tid, mainPid } = await posts.getPostFields(pid, ['tid', 'mainPid']); const participants = (await db.getSortedSetMembers(`tid:${tid}:posters`)) .filter(uid => !utils.isNumber(uid)); // remote users only const announcers = (await ActivityPub.notes.announce.list({ pid })).map(({ actor }) => actor); - const auxiliaries = Array.from(new Set([...participants, ...announcers])); + const mainAnnouncers = (await ActivityPub.notes.announce.list({ pid: mainPid })).map(({ actor }) => actor); + const auxiliaries = Array.from(new Set([...participants, ...announcers, ...mainAnnouncers])); + const auxiliaryFollowers = (await user.getUsersFields(auxiliaries, ['followersUrl'])) .filter(o => o.hasOwnProperty('followersUrl')) .map(({ followersUrl }) => followersUrl);