diff --git a/src/inbox.ts b/src/inbox.ts index 50646be..dad33f7 100644 --- a/src/inbox.ts +++ b/src/inbox.ts @@ -7,7 +7,7 @@ import { send } from "./request"; export default async function inbox(activity:any) { const date = new Date() // get the main recipients ([...new Set()] is to dedupe) - const recipientList = [...new Set(idsFromValue(activity.to).concat(idsFromValue(activity.cc)).concat(idsFromValue(activity.audience)))] + const recipientList = [...new Set([...idsFromValue(activity.to), ...idsFromValue(activity.cc), ...idsFromValue(activity.audience)])] // if my list of followers in the list of recipients, then forward to them as well if(recipientList.includes(ACTOR + "/followers")) { diff --git a/src/outbox.ts b/src/outbox.ts index acd25b7..cdeccb8 100644 --- a/src/outbox.ts +++ b/src/outbox.ts @@ -35,9 +35,9 @@ export default async function outbox(activity:any):Promise { } // get the main recipients ([...new Set()] is to dedupe) - const recipientList = [...new Set(idsFromValue(activity.to).concat(idsFromValue(activity.cc)).concat(idsFromValue(activity.audience)))] + const recipientList = [...new Set([...idsFromValue(activity.to), ...idsFromValue(activity.cc), ...idsFromValue(activity.audience)])] // add in the blind recipients - const finalRecipientList = [...new Set(recipientList.concat(idsFromValue(activity.bto)).concat(idsFromValue(activity.bcc)))] + const finalRecipientList = [...new Set([...recipientList, ...idsFromValue(activity.bto), ...idsFromValue(activity.bcc)])] // remove the blind recipients from the activity delete activity.bto delete activity.bcc