diff --git a/src/controllers/activitypub/actor.ts b/src/controllers/activitypub/actor.ts index 8d09255..5d78609 100644 --- a/src/controllers/activitypub/actor.ts +++ b/src/controllers/activitypub/actor.ts @@ -12,7 +12,7 @@ const actorController: AppController = async (c) => { const event = await getAuthor(user.pubkey); if (!event) return notFound(c); - const actor = await toActor(event); + const actor = await toActor(event, user.username); if (!actor) return notFound(c); return activityJson(c, actor); diff --git a/src/transformers/nostr-to-activitypub.ts b/src/transformers/nostr-to-activitypub.ts index 82f328d..ae7ea77 100644 --- a/src/transformers/nostr-to-activitypub.ts +++ b/src/transformers/nostr-to-activitypub.ts @@ -6,13 +6,9 @@ import type { Event } from '@/event.ts'; import type { Actor } from '@/schemas/activitypub.ts'; /** Nostr metadata event to ActivityPub actor. */ -async function toActor(event: Event<0>): Promise { +async function toActor(event: Event<0>, username: string): Promise { const content = parseMetaContent(event); - if (!content.nip05) return; - const [username, hostname] = content.nip05.split('@'); - if (hostname !== Conf.url.hostname) return; - return { type: 'Person', id: Conf.local(`/users/${username}`),