Creates a bootstrap relay list for inbox that doesn't have nostr.wine to avoid sending posts there and getting the notify
This commit is contained in:
@@ -46,6 +46,7 @@ object Constants {
|
|||||||
val coracle = RelayUrlNormalizer.normalize("wss://indexer.coracle.social")
|
val coracle = RelayUrlNormalizer.normalize("wss://indexer.coracle.social")
|
||||||
val userkinds = RelayUrlNormalizer.normalize("wss://user.kindpag.es")
|
val userkinds = RelayUrlNormalizer.normalize("wss://user.kindpag.es")
|
||||||
|
|
||||||
|
val bootstrapInbox = setOf(band, damus, primal, mom, nos, bitcoiner, oxtr, fmtwiz)
|
||||||
val eventFinderRelays = setOf(band, wine, damus, primal, mom, nos, bitcoiner, oxtr, fmtwiz)
|
val eventFinderRelays = setOf(band, wine, damus, primal, mom, nos, bitcoiner, oxtr, fmtwiz)
|
||||||
|
|
||||||
val defaultSearchRelaySet = setOf(band, wine, where)
|
val defaultSearchRelaySet = setOf(band, wine, where)
|
||||||
|
|||||||
+1
-12
@@ -61,7 +61,7 @@ class Nip65RelayListState(
|
|||||||
|
|
||||||
fun normalizeNIP65WriteRelayListWithBackup(note: Note): Set<NormalizedRelayUrl> = nip65Event(note)?.writeRelaysNorm()?.toSet() ?: Constants.eventFinderRelays
|
fun normalizeNIP65WriteRelayListWithBackup(note: Note): Set<NormalizedRelayUrl> = nip65Event(note)?.writeRelaysNorm()?.toSet() ?: Constants.eventFinderRelays
|
||||||
|
|
||||||
fun normalizeNIP65ReadRelayListWithBackup(note: Note): Set<NormalizedRelayUrl> = nip65Event(note)?.readRelaysNorm()?.toSet() ?: Constants.eventFinderRelays
|
fun normalizeNIP65ReadRelayListWithBackup(note: Note): Set<NormalizedRelayUrl> = nip65Event(note)?.readRelaysNorm()?.toSet() ?: Constants.bootstrapInbox
|
||||||
|
|
||||||
fun normalizeNIP65AllRelayListWithBackup(note: Note): Set<NormalizedRelayUrl> = nip65Event(note)?.relays()?.map { it.relayUrl }?.toSet() ?: Constants.eventFinderRelays
|
fun normalizeNIP65AllRelayListWithBackup(note: Note): Set<NormalizedRelayUrl> = nip65Event(note)?.relays()?.map { it.relayUrl }?.toSet() ?: Constants.eventFinderRelays
|
||||||
|
|
||||||
@@ -89,17 +89,6 @@ class Nip65RelayListState(
|
|||||||
emptySet(),
|
emptySet(),
|
||||||
)
|
)
|
||||||
|
|
||||||
val allFlow =
|
|
||||||
getNIP65RelayListFlow()
|
|
||||||
.map { normalizeNIP65AllRelayListWithBackup(it.note) }
|
|
||||||
.onStart { emit(normalizeNIP65AllRelayListWithBackup(getNIP65RelayListNote())) }
|
|
||||||
.flowOn(Dispatchers.Default)
|
|
||||||
.stateIn(
|
|
||||||
scope,
|
|
||||||
SharingStarted.Eagerly,
|
|
||||||
emptySet(),
|
|
||||||
)
|
|
||||||
|
|
||||||
val allFlowNoDefaults =
|
val allFlowNoDefaults =
|
||||||
getNIP65RelayListFlow()
|
getNIP65RelayListFlow()
|
||||||
.map { normalizeNIP65AllRelayListWithBackupNoDefaults(it.note) }
|
.map { normalizeNIP65AllRelayListWithBackupNoDefaults(it.note) }
|
||||||
|
|||||||
+4
-4
@@ -65,11 +65,11 @@ class TrustedRelayListsState(
|
|||||||
emit(
|
emit(
|
||||||
mergeLists(
|
mergeLists(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
nip65RelayList.allFlow.value,
|
nip65RelayList.allFlowNoDefaults.value,
|
||||||
privateOutboxRelayList.flow.value,
|
privateOutboxRelayList.flow.value,
|
||||||
localRelayList.flow.value,
|
localRelayList.flow.value,
|
||||||
dmRelayList.flow.value,
|
dmRelayList.flow.value,
|
||||||
searchRelayListState.flow.value,
|
searchRelayListState.flowNoDefaults.value,
|
||||||
trustedRelayList.flow.value,
|
trustedRelayList.flow.value,
|
||||||
broadcastRelayList.flow.value,
|
broadcastRelayList.flow.value,
|
||||||
),
|
),
|
||||||
@@ -81,11 +81,11 @@ class TrustedRelayListsState(
|
|||||||
SharingStarted.Eagerly,
|
SharingStarted.Eagerly,
|
||||||
mergeLists(
|
mergeLists(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
nip65RelayList.allFlow.value,
|
nip65RelayList.allFlowNoDefaults.value,
|
||||||
privateOutboxRelayList.flow.value,
|
privateOutboxRelayList.flow.value,
|
||||||
localRelayList.flow.value,
|
localRelayList.flow.value,
|
||||||
dmRelayList.flow.value,
|
dmRelayList.flow.value,
|
||||||
searchRelayListState.flow.value,
|
searchRelayListState.flowNoDefaults.value,
|
||||||
trustedRelayList.flow.value,
|
trustedRelayList.flow.value,
|
||||||
broadcastRelayList.flow.value,
|
broadcastRelayList.flow.value,
|
||||||
),
|
),
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ fun ObserveRelayListForSearchAndDisplayIfNotFound(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
val searchRelayList by accountViewModel.account.searchRelayList.flow
|
val searchRelayList by accountViewModel.account.searchRelayList.flowNoDefaults
|
||||||
.collectAsStateWithLifecycle()
|
.collectAsStateWithLifecycle()
|
||||||
|
|
||||||
if (searchRelayList.isEmpty()) {
|
if (searchRelayList.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user