diff --git a/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts b/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts index df85f21624..e31314e135 100644 --- a/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts +++ b/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts @@ -18,11 +18,7 @@ export function getClient( const accessTokenArr = authorization?.split(" ") ?? [null]; const accessToken = accessTokenArr[accessTokenArr.length - 1]; const generator = (megalodon as any).default; - const client = generator( - "misskey", - BASE_URL, - accessToken, - ) as MegalodonInterface; + const client = generator(BASE_URL, accessToken) as MegalodonInterface; return client; } diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index 23d46eea68..c2cbb630a3 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -42,8 +42,8 @@ export function apiAccountMastodon(router: Router): void { acct.url = `${BASE_URL}/@${acct.url}`; acct.note = acct.note || ""; acct.avatar_static = acct.avatar; - acct.header = acct.header || "https://http.cat/404"; - acct.header_static = acct.header || "https://http.cat/404"; + acct.header = acct.header || "/static-assets/transparent.png"; + acct.header_static = acct.header || "/static-assets/transparent.png"; acct.source = { note: acct.note, fields: acct.fields, diff --git a/packages/backend/src/server/api/mastodon/endpoints/meta.ts b/packages/backend/src/server/api/mastodon/endpoints/meta.ts index c68a09585f..8499d62bb2 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/meta.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/meta.ts @@ -24,7 +24,7 @@ export async function getInstance(response: Entity.Instance) { status_count: await totalStatuses, domain_count: response.stats.domain_count, }, - thumbnail: response.thumbnail || "https://http.cat/404", + thumbnail: response.thumbnail || "/static-assets/transparent.png", languages: meta.langs, registrations: !meta.disableRegistration || response.registrations, approval_required: !response.registrations, @@ -96,8 +96,8 @@ export async function getInstance(response: Entity.Instance) { url: `${response.uri}/`, avatar: `${response.uri}/static-assets/badges/info.png`, avatar_static: `${response.uri}/static-assets/badges/info.png`, - header: "https://http.cat/404", - header_static: "https://http.cat/404", + header: "/static-assets/transparent.png", + header_static: "/static-assets/transparent.png", followers_count: -1, following_count: 0, statuses_count: 0, diff --git a/packages/backend/src/server/api/mastodon/endpoints/search.ts b/packages/backend/src/server/api/mastodon/endpoints/search.ts index e1aec3488b..9a07db4dcc 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/search.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/search.ts @@ -103,7 +103,7 @@ async function getHighlight( i: accessToken, }); const data: MisskeyEntity.Note[] = api.data; - return data.map((note) => Converter.note(note, domain)); + return data.map((note) => new Converter(BASE_URL).note(note, domain)); } catch (e: any) { console.log(e); console.log(e.response.data); @@ -131,7 +131,7 @@ async function getFeaturedUser( return data.map((u) => { return { source: "past_interactions", - account: Converter.userDetail(u, host), + account: new Converter(BASE_URL).userDetail(u, host), }; }); } catch (e: any) { diff --git a/packages/backend/src/server/api/mastodon/endpoints/status.ts b/packages/backend/src/server/api/mastodon/endpoints/status.ts index 86fabb59b8..759faeef96 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/status.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/status.ts @@ -449,8 +449,8 @@ export function statusModel( const now = new Date().toISOString(); return { id: "9atm5frjhb", - uri: "https://http.cat/404", // "" - url: "https://http.cat/404", // "", + uri: "/static-assets/transparent.png", // "" + url: "/static-assets/transparent.png", // "", account: { id: "9arzuvv0sw", username: "Reactions", @@ -462,11 +462,11 @@ export function statusModel( following_count: 0, statuses_count: 0, note: "", - url: "https://http.cat/404", + url: "/static-assets/transparent.png", avatar: "/static-assets/badges/info.png", avatar_static: "/static-assets/badges/info.png", - header: "https://http.cat/404", // "" - header_static: "https://http.cat/404", // "" + header: "/static-assets/transparent.png", // "" + header_static: "/static-assets/transparent.png", // "" emojis: [], fields: [], moved: null, diff --git a/packages/backend/src/server/index.ts b/packages/backend/src/server/index.ts index cd2d132199..270a8666de 100644 --- a/packages/backend/src/server/index.ts +++ b/packages/backend/src/server/index.ts @@ -166,7 +166,7 @@ mastoRouter.post("/oauth/token", async (ctx) => { let client_id: any = body.client_id; const BASE_URL = `${ctx.request.protocol}://${ctx.request.hostname}`; const generator = (megalodon as any).default; - const client = generator("misskey", BASE_URL, null) as MegalodonInterface; + const client = generator(BASE_URL, null) as MegalodonInterface; let m = null; let token = null; if (body.code) {