Improve fqn
This commit is contained in:
parent
46cdda7f7f
commit
dcf6b69501
|
@ -17,7 +17,7 @@ function parseContent(event: Event<0>): MetaContent {
|
||||||
function toAccount(event: Event<0>) {
|
function toAccount(event: Event<0>) {
|
||||||
const { pubkey } = event;
|
const { pubkey } = event;
|
||||||
const { name, nip05, picture, banner, about }: MetaContent = parseContent(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);
|
const npub = nip19.npubEncode(pubkey);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -38,7 +38,7 @@ function toAccount(event: Event<0>) {
|
||||||
header_static: banner,
|
header_static: banner,
|
||||||
locked: false,
|
locked: false,
|
||||||
note: about,
|
note: about,
|
||||||
fqn: nip05 || `${npub}@${host}`,
|
fqn: nip05 || npub,
|
||||||
url: `${origin}/users/${pubkey}`,
|
url: `${origin}/users/${pubkey}`,
|
||||||
username: nip05 ? nip05.split('@')[0] : npub,
|
username: nip05 ? nip05.split('@')[0] : npub,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue