Adding more constraints to the channel filter
This commit is contained in:
+9
-4
@@ -54,15 +54,20 @@ class ChannelFinderFilterAssembler(
|
|||||||
SincePerRelayFilter(
|
SincePerRelayFilter(
|
||||||
kinds = listOf(ChannelMetadataEvent.KIND),
|
kinds = listOf(ChannelMetadataEvent.KIND),
|
||||||
tags = mapOf("e" to reactionsToWatch),
|
tags = mapOf("e" to reactionsToWatch),
|
||||||
|
limit = 3,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createLoadEventsIfNotLoadedFilter(keys: Set<ChannelFinderQueryState>): TypedFilter? {
|
fun createLoadEventsIfNotLoadedFilter(keys: Set<ChannelFinderQueryState>): TypedFilter? {
|
||||||
val directEventsToLoad =
|
val interestedEvents =
|
||||||
keys.filter { it.channel.notes.isEmpty() && it.channel is PublicChatChannel }
|
keys.mapNotNullTo(mutableSetOf()) {
|
||||||
|
if (it.channel is PublicChatChannel && it.channel.event == null) {
|
||||||
val interestedEvents = (directEventsToLoad).map { it.channel.idHex }.toSet()
|
it.channel.idHex
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (interestedEvents.isEmpty()) {
|
if (interestedEvents.isEmpty()) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
Reference in New Issue
Block a user