Separates the q filter from the e filter to avoid and moves q to the last position since it can be cut off and won't affect the app.
This commit is contained in:
+44
-20
@@ -120,27 +120,50 @@ object NostrSingleEventDataSource : NostrDataSource("SingleEventFeed") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return groupByEOSEPresence(eventsToWatch).map {
|
return groupByEOSEPresence(eventsToWatch).map {
|
||||||
TypedFilter(
|
listOf(
|
||||||
types = COMMON_FEED_TYPES,
|
TypedFilter(
|
||||||
filter =
|
types = COMMON_FEED_TYPES,
|
||||||
JsonFilter(
|
filter =
|
||||||
kinds =
|
JsonFilter(
|
||||||
listOf(
|
kinds =
|
||||||
TextNoteEvent.KIND,
|
listOf(
|
||||||
ReactionEvent.KIND,
|
TextNoteEvent.KIND,
|
||||||
RepostEvent.KIND,
|
ReactionEvent.KIND,
|
||||||
GenericRepostEvent.KIND,
|
RepostEvent.KIND,
|
||||||
ReportEvent.KIND,
|
GenericRepostEvent.KIND,
|
||||||
LnZapEvent.KIND,
|
ReportEvent.KIND,
|
||||||
PollNoteEvent.KIND,
|
LnZapEvent.KIND,
|
||||||
),
|
PollNoteEvent.KIND,
|
||||||
tags = mapOf("e" to it.map { it.idHex }, "q" to it.map { it.idHex }),
|
),
|
||||||
since = findMinimumEOSEs(it),
|
tags = mapOf("e" to it.map { it.idHex }),
|
||||||
// Max amount of "replies" to download on a specific event.
|
since = findMinimumEOSEs(it),
|
||||||
limit = 1000,
|
// Max amount of "replies" to download on a specific event.
|
||||||
),
|
limit = 1000,
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
}.flatten()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun createQuotesFilter(): List<TypedFilter>? {
|
||||||
|
if (eventsToWatch.isEmpty()) {
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return groupByEOSEPresence(eventsToWatch).map {
|
||||||
|
listOf(
|
||||||
|
TypedFilter(
|
||||||
|
types = COMMON_FEED_TYPES,
|
||||||
|
filter =
|
||||||
|
JsonFilter(
|
||||||
|
tags = mapOf("q" to it.map { it.idHex }),
|
||||||
|
since = findMinimumEOSEs(it),
|
||||||
|
// Max amount of "replies" to download on a specific event.
|
||||||
|
limit = 1000,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}.flatten()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createLoadEventsIfNotLoadedFilter(): List<TypedFilter>? {
|
fun createLoadEventsIfNotLoadedFilter(): List<TypedFilter>? {
|
||||||
@@ -205,9 +228,10 @@ object NostrSingleEventDataSource : NostrDataSource("SingleEventFeed") {
|
|||||||
val missing = createLoadEventsIfNotLoadedFilter()
|
val missing = createLoadEventsIfNotLoadedFilter()
|
||||||
val addresses = createAddressFilter()
|
val addresses = createAddressFilter()
|
||||||
val addressReactions = createReactionsToWatchInAddressFilter()
|
val addressReactions = createReactionsToWatchInAddressFilter()
|
||||||
|
val quotes = createQuotesFilter()
|
||||||
|
|
||||||
singleEventChannel.typedFilters =
|
singleEventChannel.typedFilters =
|
||||||
listOfNotNull(missing, addresses, reactions, addressReactions).flatten().ifEmpty { null }
|
listOfNotNull(missing, addresses, reactions, addressReactions, quotes).flatten().ifEmpty { null }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun add(eventId: Note) {
|
fun add(eventId: Note) {
|
||||||
|
|||||||
Reference in New Issue
Block a user