Truncate npub username

This commit is contained in:
Alex Gleason 2023-05-11 22:34:56 -05:00
parent ef5bfb79f0
commit 1ba46dd7a3
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -62,7 +62,7 @@ async function toAccount(event: Event<0>, opts: ToAccountOpts = {}) {
note: lodash.escape(about), note: lodash.escape(about),
fqn: parsed05?.handle || npub, fqn: parsed05?.handle || npub,
url: `${origin}/users/${pubkey}`, url: `${origin}/users/${pubkey}`,
username: parsed05?.nickname || npub, username: parsed05?.nickname || npub.substring(0, 8),
}; };
} }
@ -83,7 +83,7 @@ async function toMention(pubkey: string) {
return { return {
id: pubkey, id: pubkey,
acct: npub, acct: npub,
username: npub, username: npub.substring(0, 8),
url: `${origin}/users/${pubkey}`, url: `${origin}/users/${pubkey}`,
}; };
} }