From d9f7844411d5a856c3eeaf90fe3e69745a3a5802 Mon Sep 17 00:00:00 2001 From: mkljczk Date: Thu, 27 Mar 2025 12:52:16 +0100 Subject: [PATCH] pl-api: define support for status preview for mitra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicole Mikołajczyk --- packages/pl-api/lib/client.ts | 6 +++++- packages/pl-api/lib/features.ts | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/pl-api/lib/client.ts b/packages/pl-api/lib/client.ts index 7d1bda6e0..5ec98e0e0 100644 --- a/packages/pl-api/lib/client.ts +++ b/packages/pl-api/lib/client.ts @@ -2004,7 +2004,11 @@ class PlApiClient { fixedParams.visibility = 'circle'; } - const response = await this.request('/api/v1/statuses', { + const input = params.preview && this.features.version.software === MITRA + ? '/api/v1/statuses/preview' + : '/api/v1/statuses'; + + const response = await this.request(input, { method: 'POST', body: fixedParams, }); diff --git a/packages/pl-api/lib/features.ts b/packages/pl-api/lib/features.ts index 4197921bc..2b886ae38 100644 --- a/packages/pl-api/lib/features.ts +++ b/packages/pl-api/lib/features.ts @@ -472,10 +472,12 @@ const getFeatures = (instance: Instance) => { /** * @see POST /api/v1/statuses + * @see POST /api/v1/statuses/preview */ createStatusPreview: any([ v.software === AKKOMA, v.software === PLEROMA, + v.software === MITRA, ]), /**