Minimizing the number of filters for group chat metadata

This commit is contained in:
Vitor Pamplona 2024-08-22 09:55:28 -04:00
parent 6c45bb1ca1
commit ae686671ba

View File

@ -108,18 +108,18 @@ object NostrChatroomListDataSource : AmethystNostrDataSource("MailBoxFeed") {
if (followingEvents.isEmpty()) return null
return followingEvents.map {
return listOf(
TypedFilter(
// Metadata comes from any relay
types = EVENT_FINDER_TYPES,
filter =
SincePerRelayFilter(
kinds = listOf(ChannelMetadataEvent.KIND),
tags = mapOf("e" to listOf(it)),
limit = 1,
tags = mapOf("e" to followingEvents.toList()),
limit = followingEvents.size * 2,
),
)
}
),
)
}
fun createLastMessageOfEachChannelFilter(): List<TypedFilter>? {