diff --git a/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt b/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt index 11a0a7525..d3b78418a 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -1581,6 +1581,12 @@ class Account( }.toTypedArray() } + fun convertGlobalRelays(): Array { + return localRelays.filter { it.feedTypes.contains(FeedType.GLOBAL) } + .map { it.url } + .toTypedArray() + } + fun reconnectIfRelaysHaveChanged() { val newRelaySet = activeRelays() ?: convertLocalRelays() if (!Client.isSameRelaySetConfig(newRelaySet)) { diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/HomeNewThreadFeedFilter.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/HomeNewThreadFeedFilter.kt index 90f2b2f02..2fa8ea6c0 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/HomeNewThreadFeedFilter.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/HomeNewThreadFeedFilter.kt @@ -37,6 +37,7 @@ class HomeNewThreadFeedFilter(val account: Account) : AdditiveFeedFilter() private fun innerApplyFilter(collection: Collection, ignoreAddressables: Boolean): Set { val isGlobal = account.defaultHomeFollowList == GLOBAL_FOLLOWS + val gRelays = account.convertGlobalRelays() val isHiddenList = showHiddenKey() val followingKeySet = account.selectedUsersFollowList(account.defaultHomeFollowList) ?: emptySet() @@ -51,9 +52,10 @@ class HomeNewThreadFeedFilter(val account: Account) : AdditiveFeedFilter() .asSequence() .filter { it -> val noteEvent = it.event + val isGlobalRelay = it.relays?.any { gRelays.contains(it) } ?: false (noteEvent is TextNoteEvent || noteEvent is ClassifiedsEvent || noteEvent is RepostEvent || noteEvent is GenericRepostEvent || noteEvent is LongTextNoteEvent || noteEvent is PollNoteEvent || noteEvent is HighlightEvent || noteEvent is AudioTrackEvent) && (!ignoreAddressables || noteEvent.kind() < 10000) && - (isGlobal || it.author?.pubkeyHex in followingKeySet || noteEvent.isTaggedHashes(followingTagSet) || noteEvent.isTaggedGeoHashes(followingGeoSet) || noteEvent.isTaggedAddressableNotes(followingCommunities)) && + ((isGlobal && isGlobalRelay) || it.author?.pubkeyHex in followingKeySet || noteEvent.isTaggedHashes(followingTagSet) || noteEvent.isTaggedGeoHashes(followingGeoSet) || noteEvent.isTaggedAddressableNotes(followingCommunities)) && // && account.isAcceptable(it) // This filter follows only. No need to check if acceptable (isHiddenList || it.author?.let { !account.isHidden(it.pubkeyHex) } ?: true) && ((it.event?.createdAt() ?: 0) < oneMinuteInTheFuture) &&