From cfefd56a55ff116461ab3e4090ef495242094606 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Mon, 9 Dec 2024 11:02:15 +0100 Subject: [PATCH] feat(api): :alien: Expose emoji limits in /api/v2/instance --- api/api/v2/instance/index.ts | 5 +++++ docs/api/mastodon.md | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/api/api/v2/instance/index.ts b/api/api/v2/instance/index.ts index bc6fe196..93fe600b 100644 --- a/api/api/v2/instance/index.ts +++ b/api/api/v2/instance/index.ts @@ -200,6 +200,11 @@ export default apiRoute((app) => max_description_characters: config.validation.max_media_description_size, }, + emojis: { + emoji_size_limit: config.validation.max_emoji_size, + max_emoji_description_characters: + config.validation.max_emoji_description_size, + }, polls: { max_characters_per_option: config.validation.max_poll_option_size, diff --git a/docs/api/mastodon.md b/docs/api/mastodon.md index 42888943..a4202a9c 100644 --- a/docs/api/mastodon.md +++ b/docs/api/mastodon.md @@ -15,7 +15,7 @@ Refetches the user's profile information from remote servers. Does not work for - **Permissions**: `read:account` - **Version History**: - `0.7.0`: Added. - + ### Request #### Example @@ -317,6 +317,13 @@ Extra attributes have been added to the `/api/v2/instance` endpoint. These are i ```ts type ExtendedInstanceV2 = Instance & { versia_version: string; + configuration: Instance["configuration"] & { + emojis: { + // In bytes + emoji_size_limit: number; + max_emoji_description_characters: number; + }; + }; sso: { forced: boolean; providers: SSOProvider[]; @@ -366,4 +373,4 @@ URI of the account's Versia entity (for federation). Similar to Mastodon's `uri` The `username` parameter can now (optionally) be set to change the user's handle. > [!WARNING] -> Clients should indicate to users that changing their handle will break existing links to their profile. This is reversible, but the old handle will be available for anyone to claim. \ No newline at end of file +> Clients should indicate to users that changing their handle will break existing links to their profile. This is reversible, but the old handle will be available for anyone to claim.