diff --git a/app/src/main/java/com/koalasat/pokey/models/ExternalSigner.kt b/app/src/main/java/com/koalasat/pokey/models/ExternalSigner.kt index 596e25f..b741801 100644 --- a/app/src/main/java/com/koalasat/pokey/models/ExternalSigner.kt +++ b/app/src/main/java/com/koalasat/pokey/models/ExternalSigner.kt @@ -50,7 +50,7 @@ object ExternalSigner { } } - fun auth(relayUrl: String, challenge: String, onReady: (String) -> Unit) { + fun auth(relayUrl: String, challenge: String, onReady: (Event) -> Unit) { val pubKey = Pokey.getInstance().getHexKey() val createdAt = TimeUtils.now() val kind = 22242 @@ -71,6 +71,24 @@ object ExternalSigner { content = content, sig = "", ) + externalSignerLauncher.openSigner( + event, + ) { + onReady( + Event( + id = id, + pubKey = pubKey, + createdAt = createdAt, + kind = kind, + tags = tags, + content = content, + sig = it, + ), + ) + } + } + + fun sign(event: Event, onReady: (String) -> Unit) { externalSignerLauncher.openSigner( event, onReady, diff --git a/app/src/main/java/com/koalasat/pokey/service/NotificationsService.kt b/app/src/main/java/com/koalasat/pokey/service/NotificationsService.kt index 16228b8..38b9fe8 100644 --- a/app/src/main/java/com/koalasat/pokey/service/NotificationsService.kt +++ b/app/src/main/java/com/koalasat/pokey/service/NotificationsService.kt @@ -64,7 +64,9 @@ class NotificationsService : Service() { override fun onAuth(relay: Relay, challenge: String) { Log.d("Pokey", "Relay on Auth: ${relay.url} : $challenge") ExternalSigner.auth(relay.url, challenge) { result -> - Log.d("Pokey", "Relay on Auth response: ${relay.url} : $result") + Log.d("Pokey", "Relay on Auth response: ${relay.url} : ${result.toJson()}") + relay.send(result) + relay.renewFilters() } } diff --git a/app/src/main/java/com/koalasat/pokey/ui/relays/RelaysFragment.kt b/app/src/main/java/com/koalasat/pokey/ui/relays/RelaysFragment.kt index f0f4b55..1b9e9ab 100644 --- a/app/src/main/java/com/koalasat/pokey/ui/relays/RelaysFragment.kt +++ b/app/src/main/java/com/koalasat/pokey/ui/relays/RelaysFragment.kt @@ -118,6 +118,8 @@ class RelaysFragment : Fragment() { binding.addPrivateRelayUrl.error = getString(R.string.invalid_uri) } } + binding.publishPrivateRelay.setOnClickListener { + } binding.reloadPrivateRelay.setOnClickListener { Pokey.updateLoadingPrivateRelays(true) reconnectRelays(privateRelaysKind) diff --git a/app/src/main/res/drawable/ic_remove_red_24dp.xml b/app/src/main/res/drawable/ic_remove_red_24dp.xml index 20dac3e..d073db5 100644 --- a/app/src/main/res/drawable/ic_remove_red_24dp.xml +++ b/app/src/main/res/drawable/ic_remove_red_24dp.xml @@ -1,11 +1,2 @@ - - - - - + +