Better nip44 error messages for notifications
This commit is contained in:
+4
-1
@@ -55,11 +55,14 @@ class EventNotificationConsumer(
|
|||||||
|
|
||||||
// PushNotification Wraps don't include a receiver.
|
// PushNotification Wraps don't include a receiver.
|
||||||
// Test with all logged in accounts
|
// Test with all logged in accounts
|
||||||
|
var matchAccount = false
|
||||||
LocalPreferences.allSavedAccounts().forEach {
|
LocalPreferences.allSavedAccounts().forEach {
|
||||||
if (it.hasPrivKey || it.loggedInWithExternalSigner) {
|
if (!matchAccount && it.hasPrivKey || it.loggedInWithExternalSigner) {
|
||||||
LocalPreferences.loadCurrentAccountFromEncryptedStorage(it.npub)?.let { acc ->
|
LocalPreferences.loadCurrentAccountFromEncryptedStorage(it.npub)?.let { acc ->
|
||||||
|
Log.d("EventNotificationConsumer", "New Notification Testing if for ${it.npub}")
|
||||||
try {
|
try {
|
||||||
consumeIfMatchesAccount(event, acc)
|
consumeIfMatchesAccount(event, acc)
|
||||||
|
matchAccount = true
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
// Not for this account.
|
// Not for this account.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,8 +118,7 @@ class Nip44(
|
|||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("CryptoUtils", "Could not identify the version for NIP44 payload $json")
|
Log.e("CryptoUtils", "NIP44: Unable to find version and decrypt $json", e)
|
||||||
e.printStackTrace()
|
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,8 +139,7 @@ class Nip44(
|
|||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("CryptoUtils", "Could not identify the version for NIP44 payload $payload")
|
Log.e("CryptoUtils", "NIP44: Unable to find version and decrypt $payload", e)
|
||||||
e.printStackTrace()
|
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user