Improve fqn

This commit is contained in:
Alex Gleason 2023-03-18 17:20:46 -05:00
parent 46cdda7f7f
commit dcf6b69501
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ function parseContent(event: Event<0>): MetaContent {
function toAccount(event: Event<0>) {
const { pubkey } = event;
const { name, nip05, picture, banner, about }: MetaContent = parseContent(event);
const { host, origin } = new URL(LOCAL_DOMAIN);
const { origin } = new URL(LOCAL_DOMAIN);
const npub = nip19.npubEncode(pubkey);
return {
@ -38,7 +38,7 @@ function toAccount(event: Event<0>) {
header_static: banner,
locked: false,
note: about,
fqn: nip05 || `${npub}@${host}`,
fqn: nip05 || npub,
url: `${origin}/users/${pubkey}`,
username: nip05 ? nip05.split('@')[0] : npub,
};