print naddr if parsed event is replaceable.

This commit is contained in:
fiatjaf 2023-06-20 15:31:53 -03:00
parent 4e5f7e6d21
commit 015cfd857c
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

View File

@ -273,6 +273,25 @@ object Components {
NIP19.encode(EventPointer(id, author = event.pubkey))
)
),
if event.kind >= 30000 && event.kind < 40000 then
event.pubkey
.map(author =>
nip19_21(
store,
"naddr",
NIP19.encode(
AddressPointer(
d = event.tags
.collectFirst { case "d" :: v :: _ => v }
.getOrElse(""),
kind = event.kind,
author = author,
relays = List.empty
)
)
)
)
else
event.id.map(id =>
entry(
"note",