From 1472c21cb6110080d95ce377d15b6c59741fdccb Mon Sep 17 00:00:00 2001 From: Johann150 Date: Fri, 31 Mar 2023 07:59:20 +0200 Subject: [PATCH] activitypub: properly handle all scopes for renotes This was not implemented because of concerns raised in https://github.com/misskey-dev/misskey/issues/8261 about Mastodon incorrectly interpreting the scope on renotes. However this bug seems to be fixed so it can now be implemented. See also https://github.com/misskey-dev/misskey/pull/10291 Co-authored-by: Kagami Sascha Rosylight --- packages/backend/src/remote/activitypub/renderer/announce.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/remote/activitypub/renderer/announce.ts b/packages/backend/src/remote/activitypub/renderer/announce.ts index 2709fea51..7e84e1b2b 100644 --- a/packages/backend/src/remote/activitypub/renderer/announce.ts +++ b/packages/backend/src/remote/activitypub/renderer/announce.ts @@ -13,8 +13,10 @@ export default (object: any, note: Note) => { } else if (note.visibility === 'home') { to = [`${attributedTo}/followers`]; cc = ['https://www.w3.org/ns/activitystreams#Public']; + } else if (note.visibility === 'followers') { + to = [`${attributedTo}/followers`]; } else { - return null; + throw new Error('Invalid visibility for pure renote.'); } return {