From 22cc9eb5b23000a7ebd3c15e890485600fa18b98 Mon Sep 17 00:00:00 2001 From: Will Murphy Date: Fri, 5 Nov 2021 00:06:27 -0500 Subject: [PATCH] Announce the object --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 6ded09b..92fc8c4 100644 --- a/index.js +++ b/index.js @@ -98,8 +98,9 @@ app.on('apex-inbox', async ({ actor, activity, recipient, object }) => { switch (activity.type.toLowerCase()) { // automatically reshare incoming posts case 'create': { - if (!apex.audienceFromActivity(activity).includes(recipient.id)) { - // ignore forwarded messages that aren't directly adddressed to group + // check audience to ignore forwarded messages not adddressed to group + const audience = apex.audienceFromActivity(activity) + if (!audience.includes(recipient.id) || !activity.object?.length) { return } const to = [ @@ -107,7 +108,7 @@ app.on('apex-inbox', async ({ actor, activity, recipient, object }) => { apex.consts.publicAddress ] const share = await apex.buildActivity('Announce', recipient.id, to, { - object: activity.id + object: activity.object[0].id }) apex.addToOutbox(recipient, share) break