diff --git a/src/controllers/api/accounts.ts b/src/controllers/api/accounts.ts index b8f75521..d9f2292b 100644 --- a/src/controllers/api/accounts.ts +++ b/src/controllers/api/accounts.ts @@ -4,7 +4,7 @@ import { z } from 'zod'; import { type AppController } from '@/app.ts'; import { Conf } from '@/config.ts'; -import { getAuthor, getAuthorFallback, getFollowedPubkeys } from '@/queries.ts'; +import { getAuthor, getFollowedPubkeys } from '@/queries.ts'; import { booleanParamSchema, fileSchema } from '@/schema.ts'; import { Storages } from '@/storages.ts'; import { uploadFile } from '@/utils/upload.ts'; @@ -79,7 +79,7 @@ const verifyCredentialsController: AppController = async (c) => { const accountController: AppController = async (c) => { const pubkey = c.req.param('pubkey'); - const event = await getAuthorFallback(pubkey); + const event = await getAuthor(pubkey); if (event) { return c.json(await renderAccount(event)); } else { @@ -244,7 +244,7 @@ const updateCredentialsController: AppController = async (c) => { return c.json(result.error, 422); } - const author = await getAuthorFallback(pubkey); + const author = await getAuthor(pubkey); const meta = author ? n.json().pipe(n.metadata()).catch({}).parse(author.content) : {}; const { diff --git a/src/controllers/api/statuses.ts b/src/controllers/api/statuses.ts index 360e13c8..4185b960 100644 --- a/src/controllers/api/statuses.ts +++ b/src/controllers/api/statuses.ts @@ -9,7 +9,7 @@ import { type AppController } from '@/app.ts'; import { Conf } from '@/config.ts'; import { DittoDB } from '@/db/DittoDB.ts'; import { getUnattachedMediaByIds } from '@/db/unattached-media.ts'; -import { getAncestors, getAuthorFallback, getDescendants, getEvent } from '@/queries.ts'; +import { getAncestors, getAuthor, getDescendants, getEvent } from '@/queries.ts'; import { renderEventAccounts } from '@/views.ts'; import { renderReblog, renderStatus } from '@/views/mastodon/statuses.ts'; import { Storages } from '@/storages.ts'; @@ -163,7 +163,7 @@ const createStatusController: AppController = async (c) => { tags, }, c); - const author = await getAuthorFallback(event.pubkey); + const author = await getAuthor(event.pubkey); if (data.quote_id) { await hydrateEvents({ @@ -189,7 +189,7 @@ const deleteStatusController: AppController = async (c) => { tags: [['e', id]], }, c); - const author = await getAuthorFallback(event.pubkey); + const author = await getAuthor(event.pubkey); return c.json(await renderStatus({ ...event, author }, { viewerPubkey: pubkey })); } else { return c.json({ error: 'Unauthorized' }, 403);