From de5c0d4681063588b6309f20b0fc5db09c28a045 Mon Sep 17 00:00:00 2001 From: greenart7c3 Date: Wed, 13 Sep 2023 09:32:24 -0300 Subject: [PATCH] do not try decrypt private zaps for now --- .../vitorpamplona/amethyst/model/Account.kt | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt b/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt index 3f41b52bf..83723718f 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -2594,23 +2594,25 @@ class Account( val loggedInPrivateKey = keyPair.privKey if (loginWithAmber && event is LnZapRequestEvent && event.isPrivateZap()) { - val decryptedContent = AmberUtils.cachedDecryptedContent[event.id] - if (decryptedContent != null) { - return try { - Event.fromJson(decryptedContent) - } catch (e: Exception) { - null - } - } - AmberUtils.decryptZapEvent(event) - if (AmberUtils.content.isBlank()) return null - if (AmberUtils.content == "Could not decrypt the message") return null - AmberUtils.cachedDecryptedContent[event.id] = AmberUtils.content - return try { - Event.fromJson(AmberUtils.content) - } catch (e: Exception) { - null - } + // never decrypt zaps for now, it keeps opening amber for very private zap event + return null +// val decryptedContent = AmberUtils.cachedDecryptedContent[event.id] +// if (decryptedContent != null) { +// return try { +// Event.fromJson(decryptedContent) +// } catch (e: Exception) { +// null +// } +// } +// AmberUtils.decryptZapEvent(event) +// if (AmberUtils.content.isBlank()) return null +// if (AmberUtils.content == "Could not decrypt the message") return null +// AmberUtils.cachedDecryptedContent[event.id] = AmberUtils.content +// return try { +// Event.fromJson(AmberUtils.content) +// } catch (e: Exception) { +// null +// } } return if (event is LnZapRequestEvent && loggedInPrivateKey != null && event.isPrivateZap()) {