From 82db61ede0afb6b4fac6e25caa0da959a409916c Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 30 Mar 2023 03:15:06 +0000 Subject: [PATCH] fix: direct boost (#9783) Sorry to create PR multiple times. I should have included this in #9778. Co-authored-by: naskya Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9783 Co-authored-by: naskya Co-committed-by: naskya --- .../backend/src/remote/activitypub/renderer/announce.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/remote/activitypub/renderer/announce.ts b/packages/backend/src/remote/activitypub/renderer/announce.ts index bb04a7f3d7..1fd1842acf 100644 --- a/packages/backend/src/remote/activitypub/renderer/announce.ts +++ b/packages/backend/src/remote/activitypub/renderer/announce.ts @@ -4,6 +4,10 @@ import type { Note } from "@/models/entities/note.js"; export default (object: any, note: Note) => { const attributedTo = `${config.url}/users/${note.userId}`; + const mentions = ( + JSON.parse(note.mentionedRemoteUsers) as IMentionedRemoteUsers + ).map((x) => x.uri); + let to: string[] = []; let cc: string[] = []; @@ -13,9 +17,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') { + } else if (note.visibility === "followers") { to = [`${attributedTo}/followers`]; - cc = []; + } else if (note.visibility === "specified") { + to = mentions; } else { return null; }