nostr-to-activitypub.ts --> activitypub/actor.ts

This commit is contained in:
Alex Gleason 2023-10-06 15:09:01 -05:00
parent 1662f616ef
commit 180fdbd1c9
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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 };