From 46bb5f2dac16a54bcaedafaed397c8cdc02d7008 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Mon, 30 Oct 2023 12:53:28 +0100 Subject: [PATCH] fix: lists not being received properly --- .../src/server/api/mastodon/endpoints/timeline.ts | 3 +-- packages/megalodon/src/misskey.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts index 152d4a7729..0f2b208153 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts @@ -151,8 +151,7 @@ export class ApiTimelineMastodon { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; const client = getClient(BASE_URL, accessTokens); - const account = await client.verifyAccountCredentials(); - const data = await client.getLists(account.data.id); + const data = await client.getLists(); reply.send(data.data.map((list: Entity.List) => convertList(list))); } catch (e: any) { console.error(e); diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index a0b222c230..7d68d4eddf 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -1892,9 +1892,15 @@ export default class Misskey implements MegalodonInterface { /** * POST /api/users/lists/list */ - public async getLists(id: string): Promise>> { + public async getLists(id?: string): Promise>> { + if (id) { + return this.client + .post>('/api/users/lists/list', { userId: id }) + .then(res => ({ ...res, data: res.data.map(l => MisskeyAPI.Converter.list(l)) })) + } + return this.client - .post>('/api/users/lists/list', { userId: id }) + .post>('/api/users/lists/list', {}) .then(res => ({ ...res, data: res.data.map(l => MisskeyAPI.Converter.list(l)) })) }