From 2ce3a1164514ab2cfd047fcb05b9041fa4387306 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 19 Apr 2024 23:36:43 -0400 Subject: [PATCH] feat: handle 1b14 announce for remote content too --- src/activitypub/inbox.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.js index 817b569f68..7ae1a47a9e 100644 --- a/src/activitypub/inbox.js +++ b/src/activitypub/inbox.js @@ -40,6 +40,19 @@ inbox.create = async (req) => { const response = await activitypub.notes.assert(0, object); if (response) { winston.verbose(`[activitypub/inbox] Parsing ${response.count} notes into topic ${response.tid}`); + + // todo: put this somewhere better if need be... maybe this is better as api.activitypub.announce.note? + 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`, + type: 'Announce', + to: [`${nconf.get('url')}/category/${cid}/followers`], + cc: [activitypub._constants.publicAddress], + object, + }); + } } };