From 99a98439cdd8ced16138f25945a5add4061cf38b Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sat, 12 Aug 2023 14:56:29 -0400 Subject: [PATCH] Uses the right account to decrypt GiftWraps --- .../vitorpamplona/amethyst/service/NostrAccountDataSource.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/service/NostrAccountDataSource.kt b/app/src/main/java/com/vitorpamplona/amethyst/service/NostrAccountDataSource.kt index ac4c5dc86..9ce1400ac 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/service/NostrAccountDataSource.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/service/NostrAccountDataSource.kt @@ -127,7 +127,7 @@ object NostrAccountDataSource : NostrDataSource("AccountData") { override fun consume(event: Event, relay: Relay) { if (LocalCache.justVerify(event)) { if (event is GiftWrapEvent) { - val privateKey = NostrChatroomListDataSource.account.keyPair.privKey + val privateKey = account.keyPair.privKey if (privateKey != null) { event.cachedGift(privateKey)?.let { this.consume(it, relay) @@ -136,7 +136,7 @@ object NostrAccountDataSource : NostrDataSource("AccountData") { } if (event is SealedGossipEvent) { - val privateKey = NostrChatroomListDataSource.account.keyPair.privKey + val privateKey = account.keyPair.privKey if (privateKey != null) { event.cachedGossip(privateKey)?.let { LocalCache.justConsume(it, relay)