From 0ccd41f5e824d7de001020ca867a774490945b7f Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 31 Aug 2023 13:21:08 -0400 Subject: [PATCH] Fixes wrong EOSE updates. --- .../com/vitorpamplona/amethyst/service/NostrDataSource.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/service/NostrDataSource.kt b/app/src/main/java/com/vitorpamplona/amethyst/service/NostrDataSource.kt index 7bf7084f1..55f01d3b4 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/service/NostrDataSource.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/service/NostrDataSource.kt @@ -49,7 +49,7 @@ abstract class NostrDataSource(val debugName: String) { // Log.e("ERROR", "Relay ${relay.url}: ${error.message}") } - override fun onRelayStateChange(type: Relay.Type, relay: Relay, channel: String?) { + override fun onRelayStateChange(type: Relay.Type, relay: Relay, subscriptionId: String?) { // Log.d("RELAY", "Relay ${relay.url} ${when (type) { // Relay.Type.CONNECT -> "connected." // Relay.Type.DISCONNECT -> "disconnected." @@ -57,9 +57,9 @@ abstract class NostrDataSource(val debugName: String) { // Relay.Type.EOSE -> "sent all events it had stored." // }}") - if (type == Relay.Type.EOSE && channel != null) { + if (type == Relay.Type.EOSE && subscriptionId != null && subscriptionId in subscriptions.keys) { // updates a per subscripton since date - subscriptions[channel]?.updateEOSE(TimeUtils.now(), relay.url) + subscriptions[subscriptionId]?.updateEOSE(TimeUtils.now(), relay.url) } }