mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-29 06:52:50 +02:00
Fixes missing relays certain internal lists
This commit is contained in:
@@ -269,7 +269,7 @@ class Account(
|
||||
mappedRelaySet =
|
||||
mappedRelaySet.map {
|
||||
if (searchRelaySet.contains(it.url)) {
|
||||
Relay(it.url, true, false, it.activeTypes + FeedType.SEARCH)
|
||||
Relay(it.url, true, it.write || false, it.activeTypes + FeedType.SEARCH)
|
||||
} else {
|
||||
it
|
||||
}
|
||||
@@ -2606,18 +2606,14 @@ class Account(
|
||||
}
|
||||
|
||||
fun activeGlobalRelays(): Array<String> {
|
||||
return (activeRelays() ?: convertLocalRelays())
|
||||
return connectToRelays.value
|
||||
.filter { it.activeTypes.contains(FeedType.GLOBAL) }
|
||||
.map { it.url }
|
||||
.toTypedArray()
|
||||
}
|
||||
|
||||
fun activeWriteRelays(): List<Relay> {
|
||||
return (activeRelays() ?: convertLocalRelays()).filter { it.write }
|
||||
}
|
||||
|
||||
fun activeAllRelays(): List<Relay> {
|
||||
return ((activeRelays() ?: convertLocalRelays()).toList())
|
||||
return connectToRelays.value.filter { it.write }
|
||||
}
|
||||
|
||||
fun isAllHidden(users: Set<HexKey>): Boolean {
|
||||
|
@@ -181,8 +181,7 @@ object NostrAccountDataSource : NostrDataSource("AccountData") {
|
||||
?.followList
|
||||
?.get(account.defaultNotificationFollowList.value)
|
||||
?.relayList
|
||||
?: account.activeRelays()?.associate { it.url to EOSETime(TimeUtils.oneWeekAgo()) }
|
||||
?: account.convertLocalRelays().associate { it.url to EOSETime(TimeUtils.oneWeekAgo()) }
|
||||
?: account.connectToRelays.value.associate { it.url to EOSETime(TimeUtils.oneWeekAgo()) }
|
||||
|
||||
return TypedFilter(
|
||||
types = COMMON_FEED_TYPES,
|
||||
@@ -214,7 +213,7 @@ object NostrAccountDataSource : NostrDataSource("AccountData") {
|
||||
?.followList
|
||||
?.get(account.defaultNotificationFollowList.value)
|
||||
?.relayList
|
||||
?: account.activeRelays()?.associate { it.url to EOSETime(TimeUtils.oneWeekAgo()) }
|
||||
?: account.connectToRelays.value.associate { it.url to EOSETime(TimeUtils.oneWeekAgo()) }
|
||||
?: account.convertLocalRelays().associate { it.url to EOSETime(TimeUtils.oneWeekAgo()) }
|
||||
|
||||
return TypedFilter(
|
||||
|
@@ -79,7 +79,7 @@ fun RelaySelectionDialog(
|
||||
|
||||
var relays by remember {
|
||||
mutableStateOf(
|
||||
accountViewModel.account.activeAllRelays().map {
|
||||
accountViewModel.account.connectToRelays.value.map {
|
||||
RelayList(
|
||||
relay = it,
|
||||
relayInfo = RelayBriefInfoCache.RelayBriefInfo(it.url),
|
||||
|
@@ -114,7 +114,7 @@ private fun RelayOptions(
|
||||
|
||||
val isNotUsingRelay =
|
||||
remember(userState) {
|
||||
accountViewModel.account.activeRelays()?.none { it.url == relay.url } == true
|
||||
accountViewModel.account.connectToRelays.value.none { it.url == relay.url }
|
||||
}
|
||||
|
||||
if (isNotUsingRelay) {
|
||||
|
Reference in New Issue
Block a user