From d521e95dda88fb969bcd205becda9a24b8ae2dd9 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Mon, 25 Sep 2023 19:50:22 +0200 Subject: [PATCH] fix: checks --- packages/backend/src/server/api/mastodon/endpoints/status.ts | 2 +- packages/megalodon/src/misskey.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/status.ts b/packages/backend/src/server/api/mastodon/endpoints/status.ts index 20401437e8..3cf442f119 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/status.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/status.ts @@ -219,7 +219,7 @@ export class ApiStatusMastodon { const client = getClient(BASE_URL, accessTokens); const body: any = _request.body; try { - if (body.media_ids) body.media_ids = undefined; + if (!body.media_ids) body.media_ids = undefined; if (body.media_ids && !body.media_ids.length) body.media_ids = undefined; if (body.media_ids) { body.media_ids = (body.media_ids as string[]).map((p) => convertId(p, IdType.SharkeyId)); diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index 9807f0cc79..7870488303 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -1155,12 +1155,10 @@ export default class Misskey implements MegalodonInterface { text: _options.status } if (_options) { - if (_options.media_ids && _options.media_ids.length > 0) { + if (_options.media_ids) { params = Object.assign(params, { fileIds: _options.media_ids }) - } else { - _options.media_ids = null; } if (_options.poll) { let pollParam = {