fix: 1b12 conformance for inbox.create as well

This commit is contained in:
Julian Lam
2024-06-14 13:37:46 -04:00
parent 931a0f0a60
commit c8bc6e551b
2 changed files with 18 additions and 27 deletions

View File

@@ -47,13 +47,15 @@ inbox.create = async (req) => {
const cid = await topics.getTopicField(response.tid, 'cid');
const followers = await activitypub.notes.getCategoryFollowers(cid);
if (followers.length) {
await activitypub.send('cid', cid, followers, {
id: `${object.id}#activity/announce/${Date.now()}`,
type: 'Announce',
to: [`${nconf.get('url')}/category/${cid}/followers`],
cc: [activitypub._constants.publicAddress],
object,
});
await Promise.all([req.body, object].map(async (object) => {
await activitypub.send('cid', cid, followers, {
id: `${object.id}#activity/announce/${Date.now()}`,
type: 'Announce',
to: [`${nconf.get('url')}/category/${cid}/followers`],
cc: [activitypub._constants.publicAddress],
object,
});
}));
}
}
};