Skip to content

Commit

Permalink
Fixes issue with super large follow lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorpamplona committed Jul 19, 2024
1 parent d1da863 commit 2b6a48f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ object NostrHomeDataSource : AmethystNostrDataSource("HomeFeed") {

fun createFollowMetadataAndReleaseFilter(): TypedFilter? {
val follows = account.liveHomeFollowLists.value?.users
val followSet = follows?.plus(account.userProfile().pubkeyHex)?.toList()?.ifEmpty { null }
val followSet = follows?.plus(account.userProfile().pubkeyHex)?.shuffled()?.ifEmpty { null }

return if (followSet != null) {
TypedFilter(
Expand All @@ -124,7 +124,7 @@ object NostrHomeDataSource : AmethystNostrDataSource("HomeFeed") {
MetadataEvent.KIND,
AdvertisedRelayListEvent.KIND,
),
authors = followSet,
authors = followSet.take(500),
since =
latestEOSEs.users[account.userProfile()]
?.followList
Expand Down

0 comments on commit 2b6a48f

Please sign in to comment.