mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 15:36:38 +01:00
Limits the number of posts coming from big relays with too many authors to 500 max
This commit is contained in:
@@ -42,7 +42,7 @@ import com.vitorpamplona.quartz.nip84Highlights.HighlightEvent
|
|||||||
import com.vitorpamplona.quartz.nip99Classifieds.ClassifiedsEvent
|
import com.vitorpamplona.quartz.nip99Classifieds.ClassifiedsEvent
|
||||||
import com.vitorpamplona.quartz.nipA0VoiceMessages.VoiceEvent
|
import com.vitorpamplona.quartz.nipA0VoiceMessages.VoiceEvent
|
||||||
import com.vitorpamplona.quartz.nipA0VoiceMessages.VoiceReplyEvent
|
import com.vitorpamplona.quartz.nipA0VoiceMessages.VoiceReplyEvent
|
||||||
import kotlin.math.max
|
import kotlin.math.min
|
||||||
|
|
||||||
val HomePostsNewThreadKinds =
|
val HomePostsNewThreadKinds =
|
||||||
listOf(
|
listOf(
|
||||||
@@ -81,7 +81,7 @@ fun filterNewHomePostsByAuthors(
|
|||||||
Filter(
|
Filter(
|
||||||
kinds = HomePostsNewThreadKinds,
|
kinds = HomePostsNewThreadKinds,
|
||||||
authors = authorList,
|
authors = authorList,
|
||||||
limit = max(authorList.size * 10, 300),
|
limit = min(authorList.size * 10, 500),
|
||||||
since = since,
|
since = since,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -102,7 +102,7 @@ fun filterReplyHomePostsByAuthors(
|
|||||||
Filter(
|
Filter(
|
||||||
kinds = HomePostsConversationKinds,
|
kinds = HomePostsConversationKinds,
|
||||||
authors = authorList,
|
authors = authorList,
|
||||||
limit = max(authorList.size * 10, 300),
|
limit = min(authorList.size * 10, 500),
|
||||||
since = since,
|
since = since,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user