test: more out.announce tests

This commit is contained in:
Julian Lam
2026-01-06 12:08:39 -05:00
parent 27d511ff92
commit cfdbbb048d
2 changed files with 43 additions and 7 deletions

View File

@@ -323,9 +323,11 @@ Out.announce.topic = enabledCheck(async (tid) => {
const { to, cc, targets } = await activitypub.buildRecipients({
id: pid,
to: [activitypub._constants.publicAddress],
cc: [authorUid],
}, { cid });
targets.add(authorUid);
if (!utils.isNumber(authorUid)) {
cc.push(authorUid);
targets.add(authorUid);
}
await activitypub.send('cid', cid, Array.from(targets), {
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/cid/${cid}`,
@@ -333,7 +335,7 @@ Out.announce.topic = enabledCheck(async (tid) => {
actor: `${nconf.get('url')}/category/${cid}`,
to,
cc,
object: pid,
object: utils.isNumber(pid) ? `${nconf.get('url')}/post/${pid}` : pid,
});
});