mirror of
https://github.com/fiatjaf/nak.git
synced 2024-10-30 09:09:08 -04:00
print naddr if parsed event is replaceable.
This commit is contained in:
parent
4e5f7e6d21
commit
015cfd857c
|
@ -273,13 +273,32 @@ object Components {
|
||||||
NIP19.encode(EventPointer(id, author = event.pubkey))
|
NIP19.encode(EventPointer(id, author = event.pubkey))
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
event.id.map(id =>
|
if event.kind >= 30000 && event.kind < 40000 then
|
||||||
entry(
|
event.pubkey
|
||||||
"note",
|
.map(author =>
|
||||||
NIP19.encode(ByteVector32.fromValidHex(id)),
|
nip19_21(
|
||||||
Some(editable(store, NIP19.encode(ByteVector32.fromValidHex(id))))
|
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",
|
||||||
|
NIP19.encode(ByteVector32.fromValidHex(id)),
|
||||||
|
Some(editable(store, NIP19.encode(ByteVector32.fromValidHex(id))))
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
private def entry(
|
private def entry(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user