From 54e1b3d4e87fc7e63f787ef283b76316aa557ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 28 Oct 2023 16:29:29 +0200 Subject: [PATCH] Remove `poll_limits` as they're not part of instancev2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/schemas/instance.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/schemas/instance.ts b/src/schemas/instance.ts index 29bdcb945b..12faca6278 100644 --- a/src/schemas/instance.ts +++ b/src/schemas/instance.ts @@ -165,19 +165,11 @@ const instanceSchema = coerceObject({ title: z.string().catch(''), usage: usageSchema, version: z.string().catch(''), -}).transform(({ max_media_attachments, max_toot_chars, poll_limits, ...instance }) => { +}).transform(({ max_media_attachments, max_toot_chars, ...instance }) => { const { configuration } = instance; const version = fixVersion(instance.version); - const polls = { - ...configuration.polls, - max_characters_per_option: configuration.polls.max_characters_per_option ?? poll_limits.max_option_chars ?? 25, - max_expiration: configuration.polls.max_expiration ?? poll_limits.max_expiration ?? 2629746, - max_options: configuration.polls.max_options ?? poll_limits.max_options ?? 4, - min_expiration: configuration.polls.min_expiration ?? poll_limits.min_expiration ?? 300, - }; - const statuses = { ...configuration.statuses, max_characters: configuration.statuses.max_characters ?? max_toot_chars ?? 500, @@ -188,7 +180,6 @@ const instanceSchema = coerceObject({ ...instance, configuration: { ...configuration, - polls, statuses, }, version,