diff --git a/src/views/mastodon/accounts.ts b/src/views/mastodon/accounts.ts index 626203b8..663aff2c 100644 --- a/src/views/mastodon/accounts.ts +++ b/src/views/mastodon/accounts.ts @@ -45,6 +45,7 @@ async function renderAccount( } = n.json().pipe(n.metadata()).catch({}).parse(event.content); const npub = nip19.npubEncode(pubkey); + const nprofile = nip19.nprofileEncode({ pubkey, relays: [Conf.relay] }); const parsed05 = await parseAndVerifyNip05(nip05, pubkey, signal); const acct = parsed05?.handle || npub; @@ -100,7 +101,7 @@ async function renderAccount( username: parsed05?.nickname || npub.substring(0, 8), ditto: { accepts_zaps: Boolean(getLnurl({ lud06, lud16 })), - external_url: Conf.external(npub), + external_url: Conf.external(nprofile), }, domain: parsed05?.domain, pleroma: { diff --git a/src/views/mastodon/statuses.ts b/src/views/mastodon/statuses.ts index 48d8e099..3f8f1c96 100644 --- a/src/views/mastodon/statuses.ts +++ b/src/views/mastodon/statuses.ts @@ -25,7 +25,12 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise< if (depth > 2 || depth < 0) return; - const note = nip19.noteEncode(event.id); + const nevent = nip19.neventEncode({ + id: event.id, + author: event.pubkey, + kind: event.kind, + relays: [Conf.relay], + }); const account = event.author ? await renderAccount({ ...event.author, author_stats: event.author_stats }) @@ -138,7 +143,7 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise< url: Conf.local(`/@${account.acct}/${event.id}`), zapped: Boolean(zapEvent), ditto: { - external_url: Conf.external(note), + external_url: Conf.external(nevent), }, pleroma: { emoji_reactions: reactions,