From 1446514442a237619a1c448b0e1e2ecfd492f95d Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Mon, 25 Sep 2023 03:26:05 +0200 Subject: [PATCH] fix: contact person in masto instance endpoint --- .../src/server/api/mastodon/MastodonApiServerService.ts | 2 +- packages/megalodon/src/megalodon.ts | 2 +- packages/megalodon/src/misskey.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts index 128cb3491..cd0fe2433 100644 --- a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts +++ b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts @@ -93,7 +93,7 @@ export class MastodonApiServerService { }, order: { id: 'ASC' }, }); - const contact = admin == null ? null : convertAccount((await client.getAccount(admin.id)).data); + const contact = admin == null ? null : convertAccount((await client.getAccount(admin.id, BASE_URL)).data); reply.send(await getInstance(data.data, contact, this.config, await this.metaService.fetch())); } catch (e: any) { /* console.error(e); */ diff --git a/packages/megalodon/src/megalodon.ts b/packages/megalodon/src/megalodon.ts index 57ed58c3d..d75d13cf2 100644 --- a/packages/megalodon/src/megalodon.ts +++ b/packages/megalodon/src/megalodon.ts @@ -156,7 +156,7 @@ export interface MegalodonInterface { * @param id The account ID. * @return An account. */ - getAccount(id: string): Promise> + getAccount(id: string, host?: string): Promise> /** * Statuses posted to the given account. * diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index b40ad9a43..0d513651b 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -266,14 +266,14 @@ export default class Misskey implements MegalodonInterface { /** * POST /api/users/show */ - public async getAccount(id: string): Promise> { + public async getAccount(id: string, host?: string): Promise> { return this.client .post('/api/users/show', { userId: id }) .then(res => { return Object.assign(res, { - data: MisskeyAPI.Converter.userDetail(res.data) + data: MisskeyAPI.Converter.userDetail(res.data, host) }) }) }