mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-29 11:11:44 +01:00
Reduces the amount of Reports downloaded when observing single users.
This commit is contained in:
parent
b7c72a282f
commit
ccd6beee8e
@ -34,7 +34,8 @@ object NostrSingleUserDataSource: NostrDataSource("SingleUserFeed") {
|
||||
types = FeedType.values().toSet(),
|
||||
filter = JsonFilter(
|
||||
kinds = listOf(ReportEvent.kind),
|
||||
tags = mapOf("p" to listOf(it))
|
||||
tags = mapOf("p" to listOf(it)),
|
||||
since = LocalCache.users[it]?.latestReportTime
|
||||
)
|
||||
)
|
||||
}
|
||||
@ -46,8 +47,11 @@ object NostrSingleUserDataSource: NostrDataSource("SingleUserFeed") {
|
||||
invalidateFilters()
|
||||
}
|
||||
|
||||
val userChannelOnce = requestNewChannel()
|
||||
|
||||
override fun updateChannelFilters() {
|
||||
userChannel.typedFilters = listOfNotNull(createUserFilter(), createUserReportFilter()).flatten()
|
||||
userChannel.typedFilters = listOfNotNull(createUserFilter()).flatten().ifEmpty { null }
|
||||
userChannelOnce.typedFilters = listOfNotNull(createUserReportFilter()).flatten().ifEmpty { null }
|
||||
}
|
||||
|
||||
fun add(userId: String) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user