Fixes the use of Global-active relays in the Global Feed.

This commit is contained in:
Vitor Pamplona 2024-04-24 13:54:13 -04:00
parent 7a243af45c
commit fef635ab39
2 changed files with 3 additions and 5 deletions

View File

@ -77,7 +77,7 @@ object NostrHomeDataSource : NostrDataSource("HomeFeed") {
val followSet = follows?.plus(account.userProfile().pubkeyHex)?.toList()?.ifEmpty { null } val followSet = follows?.plus(account.userProfile().pubkeyHex)?.toList()?.ifEmpty { null }
return TypedFilter( return TypedFilter(
types = setOf(FeedType.FOLLOWS), types = setOf(if (follows == null) FeedType.GLOBAL else FeedType.FOLLOWS),
filter = filter =
JsonFilter( JsonFilter(
kinds = kinds =

View File

@ -85,7 +85,7 @@ class HomeNewThreadFeedFilter(val account: Account) : AdditiveFeedFilter<Note>()
} }
} }
fun acceptableEvent( private fun acceptableEvent(
it: Note, it: Note,
globalRelays: Set<String>, globalRelays: Set<String>,
filterParams: FilterByListParams, filterParams: FilterByListParams,
@ -102,9 +102,7 @@ class HomeNewThreadFeedFilter(val account: Account) : AdditiveFeedFilter<Note>()
noteEvent is HighlightEvent || noteEvent is HighlightEvent ||
noteEvent is AudioTrackEvent || noteEvent is AudioTrackEvent ||
noteEvent is AudioHeaderEvent noteEvent is AudioHeaderEvent
) && ) && filterParams.match(noteEvent, isGlobalRelay) && it.isNewThread()
filterParams.match(noteEvent, isGlobalRelay) &&
it.isNewThread()
} }
override fun sort(collection: Set<Note>): List<Note> { override fun sort(collection: Set<Note>): List<Note> {