mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-24 23:25:19 +00:00
turn off default relays
This commit is contained in:
@@ -188,7 +188,7 @@ class NostrGeohashService(
|
||||
nostrRelayManager.sendEventToGeohash(
|
||||
event = event,
|
||||
geohash = channel.geohash,
|
||||
includeDefaults = true,
|
||||
includeDefaults = false,
|
||||
nRelays = 5
|
||||
)
|
||||
|
||||
@@ -551,7 +551,7 @@ class NostrGeohashService(
|
||||
handler = { event ->
|
||||
handleUnifiedGeohashEvent(event, geohash)
|
||||
},
|
||||
includeDefaults = true,
|
||||
includeDefaults = false,
|
||||
nRelays = 5
|
||||
)
|
||||
|
||||
@@ -882,7 +882,7 @@ class NostrGeohashService(
|
||||
handler = { event ->
|
||||
handleUnifiedGeohashEvent(event, channel.channel.geohash)
|
||||
},
|
||||
includeDefaults = true,
|
||||
includeDefaults = false,
|
||||
nRelays = 5
|
||||
)
|
||||
|
||||
@@ -909,7 +909,7 @@ class NostrGeohashService(
|
||||
handler = { giftWrap ->
|
||||
handleGeohashDmEvent(giftWrap, channel.channel.geohash, dmIdentity)
|
||||
},
|
||||
includeDefaults = true,
|
||||
includeDefaults = false,
|
||||
nRelays = 5
|
||||
)
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ class NostrRelayManager private constructor() {
|
||||
/**
|
||||
* Compute and connect to relays for a given geohash (nearest + optional defaults), cache the mapping.
|
||||
*/
|
||||
fun ensureGeohashRelaysConnected(geohash: String, nRelays: Int = 5, includeDefaults: Boolean = true) {
|
||||
fun ensureGeohashRelaysConnected(geohash: String, nRelays: Int = 5, includeDefaults: Boolean = false) {
|
||||
try {
|
||||
val nearest = RelayDirectory.closestRelaysForGeohash(geohash, nRelays)
|
||||
val selected = if (includeDefaults) {
|
||||
@@ -163,7 +163,7 @@ class NostrRelayManager private constructor() {
|
||||
filter: NostrFilter,
|
||||
id: String = generateSubscriptionId(),
|
||||
handler: (NostrEvent) -> Unit,
|
||||
includeDefaults: Boolean = true,
|
||||
includeDefaults: Boolean = false,
|
||||
nRelays: Int = 5
|
||||
): String {
|
||||
ensureGeohashRelaysConnected(geohash, nRelays, includeDefaults)
|
||||
@@ -185,7 +185,7 @@ class NostrRelayManager private constructor() {
|
||||
/**
|
||||
* Send an event specifically to a geohash's relays (+ optional defaults).
|
||||
*/
|
||||
fun sendEventToGeohash(event: NostrEvent, geohash: String, includeDefaults: Boolean = true, nRelays: Int = 5) {
|
||||
fun sendEventToGeohash(event: NostrEvent, geohash: String, includeDefaults: Boolean = false, nRelays: Int = 5) {
|
||||
ensureGeohashRelaysConnected(geohash, nRelays, includeDefaults)
|
||||
val relayUrls = getRelaysForGeohash(geohash)
|
||||
if (relayUrls.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user