From 0949c0e0cdf9feb6f615749f456b334b8aaa37a7 Mon Sep 17 00:00:00 2001 From: Daiki Mizukami Date: Tue, 20 Aug 2024 01:44:05 +0900 Subject: [PATCH] enhance(backend): embed `liked` collection into actor object --- .../src/core/activitypub/ApRendererService.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/activitypub/ApRendererService.ts b/packages/backend/src/core/activitypub/ApRendererService.ts index 73e55c1fe5..0a88656c91 100644 --- a/packages/backend/src/core/activitypub/ApRendererService.ts +++ b/packages/backend/src/core/activitypub/ApRendererService.ts @@ -472,6 +472,16 @@ export class ApRendererService { const hashtagTags = user.tags.map(tag => this.renderHashtag(tag)); + let liked; + if (profile.publicReactions) { + const likedId = `${id}/liked`; + liked = this.renderOrderedCollection( + likedId, + undefined, + `${likedId}?page=true`, + ); + } + const tag = [ ...apemojis, ...hashtagTags, @@ -486,7 +496,7 @@ export class ApRendererService { outbox: `${id}/outbox`, followers: `${id}/followers`, following: `${id}/following`, - liked: `${id}/liked`, + liked, featured: `${id}/collections/featured`, sharedInbox: `${this.config.url}/inbox`, endpoints: { sharedInbox: `${this.config.url}/inbox` },