nostr-to-activitypub.ts --> activitypub/actor.ts
This commit is contained in:
parent
1662f616ef
commit
180fdbd1c9
|
@ -1,7 +1,7 @@
|
|||
import { findUser } from '@/db/users.ts';
|
||||
import { getAuthor } from '@/queries.ts';
|
||||
import { activityJson } from '@/utils/web.ts';
|
||||
import { toActor } from '@/views/nostr-to-activitypub.ts';
|
||||
import { renderActor } from '@/views/activitypub/actor.ts';
|
||||
|
||||
import type { AppContext, AppController } from '@/app.ts';
|
||||
|
||||
|
@ -14,7 +14,7 @@ const actorController: AppController = async (c) => {
|
|||
const event = await getAuthor(user.pubkey);
|
||||
if (!event) return notFound(c);
|
||||
|
||||
const actor = await toActor(event, user.username);
|
||||
const actor = await renderActor(event, user.username);
|
||||
if (!actor) return notFound(c);
|
||||
|
||||
return activityJson(c, actor);
|
||||
|
|
|
@ -6,7 +6,7 @@ import type { Event } from '@/deps.ts';
|
|||
import type { Actor } from '@/schemas/activitypub.ts';
|
||||
|
||||
/** Nostr metadata event to ActivityPub actor. */
|
||||
async function toActor(event: Event<0>, username: string): Promise<Actor | undefined> {
|
||||
async function renderActor(event: Event<0>, username: string): Promise<Actor | undefined> {
|
||||
const content = jsonMetaContentSchema.parse(event.content);
|
||||
|
||||
return {
|
||||
|
@ -44,4 +44,4 @@ async function toActor(event: Event<0>, username: string): Promise<Actor | undef
|
|||
};
|
||||
}
|
||||
|
||||
export { toActor };
|
||||
export { renderActor };
|
Loading…
Reference in New Issue