Unwrapps the reply message if the GiftWrap was tagged and not the inner message id.

This commit is contained in:
Vitor Pamplona
2024-02-07 16:14:48 -05:00
parent 95e19cf681
commit 68e90ce3ed
4 changed files with 67 additions and 2 deletions
@@ -38,6 +38,10 @@ class GiftWrapEvent(
) : Event(id, pubKey, createdAt, KIND, tags, content, sig) {
@Transient private var cachedInnerEvent: Map<HexKey, Event?> = mapOf()
fun preCachedGift(signer: NostrSigner): Event? {
return cachedInnerEvent[signer.pubKey]
}
fun cachedGift(
signer: NostrSigner,
onReady: (Event) -> Unit,
@@ -39,6 +39,10 @@ class SealedGossipEvent(
) : WrappedEvent(id, pubKey, createdAt, KIND, tags, content, sig) {
@Transient private var cachedInnerEvent: Map<HexKey, Event?> = mapOf()
fun preCachedGossip(signer: NostrSigner): Event? {
return cachedInnerEvent[signer.pubKey]
}
fun cachedGossip(
signer: NostrSigner,
onReady: (Event) -> Unit,