From 69bf40341dbb18444f12bb1a177589e7e48b65d3 Mon Sep 17 00:00:00 2001 From: Daiki Mizukami Date: Wed, 14 Aug 2024 14:40:53 +0900 Subject: [PATCH] enhance(backend): embed local notes in `liked` collection --- packages/backend/src/server/ActivityPubServerService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts index cffa44dde8..65f54d064e 100644 --- a/packages/backend/src/server/ActivityPubServerService.ts +++ b/packages/backend/src/server/ActivityPubServerService.ts @@ -410,13 +410,13 @@ export class ActivityPubServerService { const inStock = reactions.length === limit + 1; if (inStock) reactions.pop(); - const reactedNoteUris = await Promise.all(reactions.map(reaction => reaction.note!.uri || `${this.config.url}/notes/${reaction.note!.uri}`)); + const reactedNotes = await Promise.all(reactions.map(({ note }) => note!.uri || this.apRendererService.renderNote(note!, false))); const rendered = this.apRendererService.renderOrderedCollectionPage( `${partOf}?${url.query({ page: 'true', cursor, })}`, - reactionsCount, reactedNoteUris, partOf, + reactionsCount, reactedNotes, partOf, undefined, inStock ? `${partOf}?${url.query({ page: 'true',