From 361e46c99f38278da46c641de7ee7dc7b84f4ca1 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 24 Sep 2025 12:38:48 -0400 Subject: [PATCH] Limits the number of posts coming from big relays with too many authors to 500 max --- .../datasource/nip65Follows/FilterHomePostsByAuthors.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/datasource/nip65Follows/FilterHomePostsByAuthors.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/datasource/nip65Follows/FilterHomePostsByAuthors.kt index b9de07388..46bebbc44 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/datasource/nip65Follows/FilterHomePostsByAuthors.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/datasource/nip65Follows/FilterHomePostsByAuthors.kt @@ -42,7 +42,7 @@ import com.vitorpamplona.quartz.nip84Highlights.HighlightEvent import com.vitorpamplona.quartz.nip99Classifieds.ClassifiedsEvent import com.vitorpamplona.quartz.nipA0VoiceMessages.VoiceEvent import com.vitorpamplona.quartz.nipA0VoiceMessages.VoiceReplyEvent -import kotlin.math.max +import kotlin.math.min val HomePostsNewThreadKinds = listOf( @@ -81,7 +81,7 @@ fun filterNewHomePostsByAuthors( Filter( kinds = HomePostsNewThreadKinds, authors = authorList, - limit = max(authorList.size * 10, 300), + limit = min(authorList.size * 10, 500), since = since, ), ), @@ -102,7 +102,7 @@ fun filterReplyHomePostsByAuthors( Filter( kinds = HomePostsConversationKinds, authors = authorList, - limit = max(authorList.size * 10, 300), + limit = min(authorList.size * 10, 500), since = since, ), ),