From b75b7a7a1c7379af8992b81ddd34ea732b8814a3 Mon Sep 17 00:00:00 2001 From: Kisaragi Marine Date: Fri, 27 Dec 2024 08:54:25 +0000 Subject: [PATCH] =?UTF-8?q?enhance(backend):=20=E7=B5=B5=E6=96=87=E5=AD=97?= =?UTF-8?q?=E3=81=AE=E9=80=A3=E5=90=88=E3=81=A7=E3=83=A9=E3=82=A4=E3=82=BB?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E6=AC=84=E3=82=92=E7=9B=B8=E4=BA=92=E3=81=AB?= =?UTF-8?q?=E3=82=84=E3=82=8A=E5=8F=96=E3=82=8A=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kisaragi Marine Co-authored-by: ruruke <123709459+ruruke@users.noreply.github.com> --- packages/backend/src/core/activitypub/ApRendererService.ts | 3 +++ .../backend/src/core/activitypub/models/ApNoteService.ts | 4 ++++ packages/backend/src/core/activitypub/type.ts | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/packages/backend/src/core/activitypub/ApRendererService.ts b/packages/backend/src/core/activitypub/ApRendererService.ts index 5617a29bab22..914809506743 100644 --- a/packages/backend/src/core/activitypub/ApRendererService.ts +++ b/packages/backend/src/core/activitypub/ApRendererService.ts @@ -183,6 +183,9 @@ export class ApRendererService { // || emoji.originalUrl してるのは後方互換性のため(publicUrlはstringなので??はだめ) url: emoji.publicUrl || emoji.originalUrl, }, + _misskey_license: { + freeText: emoji.license + }, }; } diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts index eb2e771a38fc..9b8f217810be 100644 --- a/packages/backend/src/core/activitypub/models/ApNoteService.ts +++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts @@ -414,6 +414,8 @@ export class ApNoteService { originalUrl: tag.icon.url, publicUrl: tag.icon.url, updatedAt: new Date(), + // _misskey_license が存在しなければ `null` + license: (tag._misskey_license?.freeText ?? null) }); const emoji = await this.emojisRepository.findOneBy({ host, name }); @@ -435,6 +437,8 @@ export class ApNoteService { publicUrl: tag.icon.url, updatedAt: new Date(), aliases: [], + // _misskey_license が存在しなければ `null` + license: (tag._misskey_license?.freeText ?? null) }); })); } diff --git a/packages/backend/src/core/activitypub/type.ts b/packages/backend/src/core/activitypub/type.ts index 7496315f0970..72732b01dfe8 100644 --- a/packages/backend/src/core/activitypub/type.ts +++ b/packages/backend/src/core/activitypub/type.ts @@ -242,6 +242,11 @@ export interface IApEmoji extends IObject { type: 'Emoji'; name: string; updated: string; + // Misskey拡張。後方互換性のためにoptional。 + // 将来の拡張性を考慮してobjectにしている + _misskey_license?: { + freeText: string | null; + }; } export const isEmoji = (object: IObject): object is IApEmoji =>