diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/service/EventNotificationConsumer.kt b/app/src/main/java/com/greenart7c3/nostrsigner/service/EventNotificationConsumer.kt index 137c9b9f..83a187e8 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/service/EventNotificationConsumer.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/service/EventNotificationConsumer.kt @@ -83,16 +83,16 @@ class EventNotificationConsumer(private val applicationContext: Context) { request: String, encryptionType: EncryptionType, ) { - if (BuildConfig.DEBUG) { - Log.d("bunker", event.toJson()) - Log.d("bunker", request) - } - val dao = NostrSigner.getInstance().getDatabase(acc.signer.keyPair.pubKey.toNpub()).applicationDao() val notification = dao.getNotification(event.id) if (notification != null) return dao.insertNotification(NotificationEntity(0, event.id(), event.createdAt)) + if (BuildConfig.DEBUG) { + Log.d("bunker", event.toJson()) + Log.d("bunker", request) + } + val bunkerRequest = BunkerRequest.mapper.readValue(request, BunkerRequest::class.java) bunkerRequest.localKey = event.pubKey bunkerRequest.currentAccount = acc.signer.keyPair.pubKey.toNpub()