From d9f1fa3ad349bc6e95bbc8f2b1997959aa11428b Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 13 Jun 2024 17:05:37 -0400 Subject: [PATCH] feat: plumb audience into _activitypub when mocking posts --- src/activitypub/helpers.js | 3 +++ src/activitypub/mocks.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/activitypub/helpers.js b/src/activitypub/helpers.js index 88e01123a9..71639298fb 100644 --- a/src/activitypub/helpers.js +++ b/src/activitypub/helpers.js @@ -353,3 +353,6 @@ Helpers.remoteAnchorToLocalProfile = async (content) => { return content; }; + +// eslint-disable-next-line max-len +Helpers.makeSet = (object, properties) => new Set(properties.reduce((memo, property) => memo.concat(Array.isArray(object[property]) ? object[property] : [object[property]]), [])); diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js index b974b65417..3c657ba912 100644 --- a/src/activitypub/mocks.js +++ b/src/activitypub/mocks.js @@ -101,7 +101,7 @@ Mocks.post = async (objects) => { attributedTo: uid, inReplyTo: toPid, published, updated, name, content, sourceContent, - to, cc, attachment, tag, + to, cc, audience, attachment, tag, // conversation, // mastodon-specific, ignored. } = object; @@ -128,7 +128,7 @@ Mocks.post = async (objects) => { edited, editor: edited ? uid : undefined, - _activitypub: { to, cc, attachment, tag, url }, + _activitypub: { to, cc, audience, attachment, tag, url }, }; return payload;