From 08fcb3b3fa47524c107de8f03218b772e71f30ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=99=E3=81=A6=E3=81=95=E3=82=93?= <49326405+Steve-0628@users.noreply.github.com> Date: Sat, 17 Aug 2024 07:05:10 +0900 Subject: [PATCH] =?UTF-8?q?enhance(federation/profile):=20=E7=9B=B8?= =?UTF-8?q?=E4=BA=92=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AE=E3=83=86=E3=82=AD?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=8C=E9=80=A3=E5=90=88=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=20(MisskeyIO#705)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../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 8b0d94247..40d06b3ae 100644 --- a/packages/backend/src/core/activitypub/ApRendererService.ts +++ b/packages/backend/src/core/activitypub/ApRendererService.ts @@ -466,7 +466,7 @@ export class ApRendererService { this.userProfilesRepository.findOneByOrFail({ userId: user.id }), ]); - const attachment = profile.fields.map(field => ({ + const profileFields = profile.fields.map(field => ({ type: 'PropertyValue', name: field.name, value: (field.value.startsWith('http://') || field.value.startsWith('https://')) @@ -474,6 +474,16 @@ export class ApRendererService { : field.value, })); + const mutualLinks = profile.mutualLinkSections.flatMap(section => + section.mutualLinks.map(link => ({ + type: 'PropertyValue', + name: section.name ?? link.description ?? 'Link', + value: `${link.description ?? link.url}`, + })), + ); + + const attachment = mutualLinks.concat(profileFields); + const emojis = await this.getEmojis(user.emojis); const apemojis = emojis.filter(emoji => !emoji.localOnly).map(emoji => this.renderEmoji(emoji));