refactoring on method names to make them clearer
This commit is contained in:
@@ -108,7 +108,7 @@ object Client : RelayPool.Listener {
|
|||||||
checkNotInMainThread()
|
checkNotInMainThread()
|
||||||
|
|
||||||
subscriptions = subscriptions + Pair(subscriptionId, filters)
|
subscriptions = subscriptions + Pair(subscriptionId, filters)
|
||||||
RelayPool.sendFilterOnlyIfDisconnected(subscriptionId)
|
RelayPool.connectAndSendFiltersIfDisconnected()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun send(
|
fun send(
|
||||||
@@ -292,7 +292,7 @@ object Client : RelayPool.Listener {
|
|||||||
open fun onRelayStateChange(
|
open fun onRelayStateChange(
|
||||||
type: Relay.StateType,
|
type: Relay.StateType,
|
||||||
relay: Relay,
|
relay: Relay,
|
||||||
channel: String?,
|
subscriptionId: String?,
|
||||||
) = Unit
|
) = Unit
|
||||||
|
|
||||||
/** When an relay saves or rejects a new event. */
|
/** When an relay saves or rejects a new event. */
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ class Relay(
|
|||||||
return buffer.toString()
|
return buffer.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun sendFilterOnlyIfDisconnected(subscriptionId: String) {
|
fun connectAndSendFiltersIfDisconnected() {
|
||||||
checkNotInMainThread()
|
checkNotInMainThread()
|
||||||
|
|
||||||
if (socket == null) {
|
if (socket == null) {
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ object RelayPool : Relay.Listener {
|
|||||||
relays.forEach { it.sendFilter(subscriptionId) }
|
relays.forEach { it.sendFilter(subscriptionId) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun sendFilterOnlyIfDisconnected(subscriptionId: String) {
|
fun connectAndSendFiltersIfDisconnected() {
|
||||||
relays.forEach { it.sendFilterOnlyIfDisconnected(subscriptionId) }
|
relays.forEach { it.connectAndSendFiltersIfDisconnected() }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun sendToSelectedRelays(
|
fun sendToSelectedRelays(
|
||||||
|
|||||||
Reference in New Issue
Block a user