mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-06 03:18:23 +00:00
desktop: use the Android app's default relays
DesktopSettings.defaultRelays was an ad-hoc list (oxtr.dev, theforest, relay.primal.net); mirror the Android app's defaultAppRelays instead (auth.nostr1.com, bucket.coracle.social, nrs.primal.net, relay.nip46.com, same order) so both signers talk to the same relays out of the box. Everything on the desktop side already reads the setting through AmberDesktop.defaultRelays(), so the single default covers the bunker connection, request routing, connect-response relay hints and the add-application screen. Fresh installs get the new set; saved settings.json files keep their relays. defaultRelaysMatchTheAndroidApp pins the list so the two apps cannot drift silently.
This commit is contained in:
@@ -166,10 +166,12 @@ data class LogRecord(
|
||||
)
|
||||
|
||||
data class DesktopSettings(
|
||||
/** Mirrors the Android app's `defaultAppRelays` (see AmberSettings.kt). */
|
||||
val defaultRelays: List<String> = listOf(
|
||||
"wss://nostr.oxtr.dev/",
|
||||
"wss://theforest.nostr1.com/",
|
||||
"wss://relay.primal.net/",
|
||||
"wss://auth.nostr1.com/",
|
||||
"wss://bucket.coracle.social/",
|
||||
"wss://nrs.primal.net/",
|
||||
"wss://relay.nip46.com/",
|
||||
),
|
||||
val currentAccount: String = "",
|
||||
val darkTheme: Boolean? = null,
|
||||
|
||||
@@ -51,6 +51,21 @@ class DesktopCoreTest {
|
||||
assertEquals(60, DesktopSettings().autoLockMinutes)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun defaultRelaysMatchTheAndroidApp() {
|
||||
// Keep in sync with `defaultAppRelays` in the Android AmberSettings.kt.
|
||||
assertEquals(
|
||||
listOf(
|
||||
"wss://auth.nostr1.com/",
|
||||
"wss://bucket.coracle.social/",
|
||||
"wss://nrs.primal.net/",
|
||||
"wss://relay.nip46.com/",
|
||||
),
|
||||
DesktopSettings().defaultRelays,
|
||||
)
|
||||
assertEquals(4, DesktopSettings().normalizedDefaultRelays().size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun parsesHexAndNsecKeys() {
|
||||
val hex = generateBunkerPrivKey()
|
||||
|
||||
Reference in New Issue
Block a user