From 3f3d277ef124d2bdcbf3256d426d0b9f6d511590 Mon Sep 17 00:00:00 2001 From: Barry Deen Date: Thu, 14 May 2026 12:05:05 -0400 Subject: [PATCH] feat(onboarding): always include relay.wisp.talk in new user's NIP-65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a new user finishes profile setup, OnboardingViewModel.finishProfile saves the discovered+tested relays locally and publishes a kind 10002 relay list event. Insert wss://relay.wisp.talk into that list before saving and publishing, so every new Wisp account advertises Wisp's relay to the network from day one. Read+write so the new user both publishes to and reads from it. Dedup on URL (case-insensitive) so we don't duplicate if probing already discovered the relay independently. Reverts the earlier change to RelayConfig.DEFAULTS — that was the wrong place. The DEFAULTS list is a fallback for users without an onboarding flow; new-account injection belongs in onboarding where the relay list event is actually constructed and published. --- app/src/main/kotlin/com/wisp/app/relay/RelayConfig.kt | 1 - .../com/wisp/app/viewmodel/OnboardingViewModel.kt | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/wisp/app/relay/RelayConfig.kt b/app/src/main/kotlin/com/wisp/app/relay/RelayConfig.kt index 1073c69..a09ba2b 100644 --- a/app/src/main/kotlin/com/wisp/app/relay/RelayConfig.kt +++ b/app/src/main/kotlin/com/wisp/app/relay/RelayConfig.kt @@ -31,7 +31,6 @@ data class RelayConfig( val DEFAULTS = listOf( RelayConfig("wss://relay.damus.io", read = true, write = true), RelayConfig("wss://relay.primal.net", read = true, write = true), - RelayConfig("wss://relay.wisp.talk", read = true, write = true), RelayConfig("wss://indexer.coracle.social", read = true, write = false), RelayConfig("wss://relay.nos.social", read = true, write = false) ) diff --git a/app/src/main/kotlin/com/wisp/app/viewmodel/OnboardingViewModel.kt b/app/src/main/kotlin/com/wisp/app/viewmodel/OnboardingViewModel.kt index da12ba4..0529611 100644 --- a/app/src/main/kotlin/com/wisp/app/viewmodel/OnboardingViewModel.kt +++ b/app/src/main/kotlin/com/wisp/app/viewmodel/OnboardingViewModel.kt @@ -95,6 +95,7 @@ class OnboardingViewModel(app: Application) : AndroidViewModel(app) { companion object { private const val TAG = "OnboardingSuggestions" + private const val WISP_RELAY_URL = "wss://relay.wisp.talk" val CREATOR_PUBKEYS = listOf( "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d", // fiatjaf "e2ccf7cf20403f3f2a4a55b328f0de3be38558a7d5f33632fdaaefc726c1c8eb" // utxo @@ -211,7 +212,15 @@ class OnboardingViewModel(app: Application) : AndroidViewModel(app) { signer: NostrSigner? = null ): Boolean { val s = signer ?: keyRepo.getKeypair()?.let { LocalSigner(it.privkey, it.pubkey) } ?: return false - val relays = _discoveredRelays.value ?: RelayConfig.DEFAULTS + val discovered = _discoveredRelays.value ?: RelayConfig.DEFAULTS + // Always include Wisp's own relay in the new account's NIP-65 list, + // regardless of what relay probing discovered. Read+write so the new + // user both publishes to and reads from it from day one. + val relays = if (discovered.any { it.url.equals(WISP_RELAY_URL, ignoreCase = true) }) { + discovered + } else { + discovered + RelayConfig(WISP_RELAY_URL, read = true, write = true) + } return try { _publishing.value = true