Show npub abbreviations instead of hex

Changelog-Changed: Show npub abbreviations instead of old-style hex
This commit is contained in:
William Casarin
2022-12-27 14:14:49 -08:00
parent aea271182e
commit 538ce45c2c
6 changed files with 15 additions and 7 deletions

View File

@@ -115,8 +115,8 @@ func mention_str(_ m: Mention, profiles: Profiles) -> String {
let disp = Profile.displayName(profile: profile, pubkey: pk)
return "[@\(disp)](nostr:\(encode_pubkey_uri(m.ref)))"
case .event:
let evid = m.ref.ref_id
return "[&\(abbrev_pubkey(evid))](nostr:\(encode_event_id_uri(m.ref)))"
let bevid = bech32_note_id(m.ref.ref_id) ?? m.ref.ref_id
return "[@\(abbrev_pubkey(bevid))](nostr:\(encode_event_id_uri(m.ref)))"
}
}