mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-04 19:14:05 +02:00
Fixing method name
This commit is contained in:
@@ -43,7 +43,7 @@ class IntentRequestDatabase {
|
|||||||
fun newResponse(data: Intent) {
|
fun newResponse(data: Intent) {
|
||||||
val callId = data.getStringExtra("id")
|
val callId = data.getStringExtra("id")
|
||||||
if (callId != null) {
|
if (callId != null) {
|
||||||
awaitingRequests[callId]?.process(data)
|
awaitingRequests[callId]?.consume(data)
|
||||||
awaitingRequests.remove(callId)
|
awaitingRequests.remove(callId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -23,5 +23,5 @@ package com.vitorpamplona.quartz.nip55AndroidSigner.api.foreground
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
|
||||||
interface NewResultProcessor {
|
interface NewResultProcessor {
|
||||||
fun process(intent: Intent)
|
fun consume(intent: Intent)
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@ import com.vitorpamplona.quartz.nip57Zaps.LnZapPrivateEvent
|
|||||||
class DecryptZapResultProcessor(
|
class DecryptZapResultProcessor(
|
||||||
val onReady: (LnZapPrivateEvent) -> Unit,
|
val onReady: (LnZapPrivateEvent) -> Unit,
|
||||||
) : NewResultProcessor {
|
) : NewResultProcessor {
|
||||||
override fun process(intent: Intent) {
|
override fun consume(intent: Intent) {
|
||||||
val foregroundResult = DecryptZapResponse.parse(intent)
|
val foregroundResult = DecryptZapResponse.parse(intent)
|
||||||
|
|
||||||
if (foregroundResult is SignerResult.Successful<ZapEventDecryptionResult>) {
|
if (foregroundResult is SignerResult.Successful<ZapEventDecryptionResult>) {
|
||||||
|
@@ -29,7 +29,7 @@ import com.vitorpamplona.quartz.nip55AndroidSigner.api.foreground.intents.respon
|
|||||||
class DeriveKeyResultProcessor(
|
class DeriveKeyResultProcessor(
|
||||||
val onReady: (String) -> Unit,
|
val onReady: (String) -> Unit,
|
||||||
) : NewResultProcessor {
|
) : NewResultProcessor {
|
||||||
override fun process(intent: Intent) {
|
override fun consume(intent: Intent) {
|
||||||
val foregroundResult = DeriveKeyResponse.parse(intent)
|
val foregroundResult = DeriveKeyResponse.parse(intent)
|
||||||
|
|
||||||
if (foregroundResult is SignerResult.Successful<DerivationResult>) {
|
if (foregroundResult is SignerResult.Successful<DerivationResult>) {
|
||||||
|
@@ -30,7 +30,7 @@ import com.vitorpamplona.quartz.nip55AndroidSigner.api.foreground.intents.respon
|
|||||||
class LoginResultProcessor(
|
class LoginResultProcessor(
|
||||||
val onReady: (HexKey, String) -> Unit,
|
val onReady: (HexKey, String) -> Unit,
|
||||||
) : NewResultProcessor {
|
) : NewResultProcessor {
|
||||||
override fun process(intent: Intent) {
|
override fun consume(intent: Intent) {
|
||||||
val foregroundResult = LoginResponse.parse(intent)
|
val foregroundResult = LoginResponse.parse(intent)
|
||||||
|
|
||||||
if (foregroundResult is SignerResult.Successful<PubKeyResult>) {
|
if (foregroundResult is SignerResult.Successful<PubKeyResult>) {
|
||||||
|
@@ -29,7 +29,7 @@ import com.vitorpamplona.quartz.nip55AndroidSigner.api.foreground.intents.respon
|
|||||||
class Nip04DecryptResultProcessor(
|
class Nip04DecryptResultProcessor(
|
||||||
val onReady: (String) -> Unit,
|
val onReady: (String) -> Unit,
|
||||||
) : NewResultProcessor {
|
) : NewResultProcessor {
|
||||||
override fun process(intent: Intent) {
|
override fun consume(intent: Intent) {
|
||||||
val foregroundResult = Nip04DecryptResponse.parse(intent)
|
val foregroundResult = Nip04DecryptResponse.parse(intent)
|
||||||
|
|
||||||
if (foregroundResult is SignerResult.Successful<DecryptionResult>) {
|
if (foregroundResult is SignerResult.Successful<DecryptionResult>) {
|
||||||
|
@@ -29,7 +29,7 @@ import com.vitorpamplona.quartz.nip55AndroidSigner.api.foreground.intents.respon
|
|||||||
class Nip04EncryptResultProcessor(
|
class Nip04EncryptResultProcessor(
|
||||||
val onReady: (String) -> Unit,
|
val onReady: (String) -> Unit,
|
||||||
) : NewResultProcessor {
|
) : NewResultProcessor {
|
||||||
override fun process(intent: Intent) {
|
override fun consume(intent: Intent) {
|
||||||
val foregroundResult = Nip04EncryptResponse.parse(intent)
|
val foregroundResult = Nip04EncryptResponse.parse(intent)
|
||||||
|
|
||||||
if (foregroundResult is SignerResult.Successful<EncryptionResult>) {
|
if (foregroundResult is SignerResult.Successful<EncryptionResult>) {
|
||||||
|
@@ -29,7 +29,7 @@ import com.vitorpamplona.quartz.nip55AndroidSigner.api.foreground.intents.respon
|
|||||||
class Nip44DecryptResultProcessor(
|
class Nip44DecryptResultProcessor(
|
||||||
val onReady: (String) -> Unit,
|
val onReady: (String) -> Unit,
|
||||||
) : NewResultProcessor {
|
) : NewResultProcessor {
|
||||||
override fun process(intent: Intent) {
|
override fun consume(intent: Intent) {
|
||||||
val foregroundResult = Nip44DecryptResponse.parse(intent)
|
val foregroundResult = Nip44DecryptResponse.parse(intent)
|
||||||
|
|
||||||
if (foregroundResult is SignerResult.Successful<DecryptionResult>) {
|
if (foregroundResult is SignerResult.Successful<DecryptionResult>) {
|
||||||
|
@@ -29,7 +29,7 @@ import com.vitorpamplona.quartz.nip55AndroidSigner.api.foreground.intents.respon
|
|||||||
class Nip44EncryptResultProcessor(
|
class Nip44EncryptResultProcessor(
|
||||||
val onReady: (String) -> Unit,
|
val onReady: (String) -> Unit,
|
||||||
) : NewResultProcessor {
|
) : NewResultProcessor {
|
||||||
override fun process(intent: Intent) {
|
override fun consume(intent: Intent) {
|
||||||
val foregroundResult = Nip44EncryptResponse.parse(intent)
|
val foregroundResult = Nip44EncryptResponse.parse(intent)
|
||||||
if (foregroundResult is SignerResult.Successful<EncryptionResult>) {
|
if (foregroundResult is SignerResult.Successful<EncryptionResult>) {
|
||||||
onReady(foregroundResult.result.ciphertext)
|
onReady(foregroundResult.result.ciphertext)
|
||||||
|
@@ -31,7 +31,7 @@ class SignResultProcessor(
|
|||||||
val unsignedEvent: Event,
|
val unsignedEvent: Event,
|
||||||
val onReady: (Event) -> Unit,
|
val onReady: (Event) -> Unit,
|
||||||
) : NewResultProcessor {
|
) : NewResultProcessor {
|
||||||
override fun process(intent: Intent) {
|
override fun consume(intent: Intent) {
|
||||||
val foregroundResult = SignResponse.parse(intent, unsignedEvent)
|
val foregroundResult = SignResponse.parse(intent, unsignedEvent)
|
||||||
|
|
||||||
if (foregroundResult is SignerResult.Successful<SignResult>) {
|
if (foregroundResult is SignerResult.Successful<SignResult>) {
|
||||||
|
Reference in New Issue
Block a user