From c5d9bde43f0e74521538163e456df02adc42849b Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sat, 26 Oct 2024 10:37:38 -0400 Subject: [PATCH] expose CW limit to frontend --- packages/backend/src/core/entities/MetaEntityService.ts | 2 ++ packages/backend/src/models/json-schema/meta.ts | 8 ++++++++ packages/backend/src/server/NodeinfoServerService.ts | 2 ++ packages/misskey-js/src/autogen/types.ts | 2 ++ 4 files changed, 14 insertions(+) diff --git a/packages/backend/src/core/entities/MetaEntityService.ts b/packages/backend/src/core/entities/MetaEntityService.ts index a94b3ae290..1c463fb0c9 100644 --- a/packages/backend/src/core/entities/MetaEntityService.ts +++ b/packages/backend/src/core/entities/MetaEntityService.ts @@ -111,6 +111,8 @@ export class MetaEntityService { logoImageUrl: instance.logoImageUrl, maxNoteTextLength: this.config.maxNoteLength, maxRemoteNoteTextLength: this.config.maxRemoteNoteLength, + maxCwLength: this.config.maxCwLength, + maxRemoteCwLength: this.config.maxRemoteCwLength, maxAltTextLength: this.config.maxAltTextLength, maxRemoteAltTextLength: this.config.maxRemoteAltTextLength, defaultLightTheme, diff --git a/packages/backend/src/models/json-schema/meta.ts b/packages/backend/src/models/json-schema/meta.ts index dbc28a7bfd..92aff24b4b 100644 --- a/packages/backend/src/models/json-schema/meta.ts +++ b/packages/backend/src/models/json-schema/meta.ts @@ -172,6 +172,14 @@ export const packedMetaLiteSchema = { type: 'number', optional: false, nullable: false, }, + maxCwLength: { + type: 'number', + optional: false, nullable: false, + }, + maxRemoteCwLength: { + type: 'number', + optional: false, nullable: false, + }, maxAltTextLength: { type: 'number', optional: false, nullable: false, diff --git a/packages/backend/src/server/NodeinfoServerService.ts b/packages/backend/src/server/NodeinfoServerService.ts index 65a2a59a74..9d33658756 100644 --- a/packages/backend/src/server/NodeinfoServerService.ts +++ b/packages/backend/src/server/NodeinfoServerService.ts @@ -123,6 +123,8 @@ export class NodeinfoServerService { enableTurnstile: meta.enableTurnstile, maxNoteTextLength: this.config.maxNoteLength, maxRemoteNoteTextLength: this.config.maxRemoteNoteLength, + maxCwLength: this.config.maxCwLength, + maxRemoteCwLength: this.config.maxRemoteCwLength, maxAltTextLength: this.config.maxAltTextLength, maxRemoteAltTextLength: this.config.maxRemoteAltTextLength, enableEmail: meta.enableEmail, diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 8167e22b7d..a1e697473d 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -5154,6 +5154,8 @@ export type components = { sidebarLogoUrl: string | null; maxNoteTextLength: number; maxRemoteNoteTextLength: number; + maxCwLength: number; + maxRemoteCwLength: number; maxAltTextLength: number; maxRemoteAltTextLength: number; ads: {