mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-11 05:19:46 +02:00
Adds a relay filter to download all reports by the user
This commit is contained in:
parent
ea9ff08d8a
commit
b334c7105c
@ -4,6 +4,7 @@ import com.vitorpamplona.amethyst.model.Account
|
||||
import com.vitorpamplona.amethyst.model.LocalCache
|
||||
import com.vitorpamplona.amethyst.model.Note
|
||||
import com.vitorpamplona.amethyst.model.UserState
|
||||
import com.vitorpamplona.amethyst.service.model.ReportEvent
|
||||
import com.vitorpamplona.amethyst.service.model.RepostEvent
|
||||
import nostr.postr.JsonFilter
|
||||
import nostr.postr.events.ContactListEvent
|
||||
@ -29,6 +30,13 @@ object NostrAccountDataSource: NostrDataSource<Note>("AccountData") {
|
||||
)
|
||||
}
|
||||
|
||||
fun createAccountReportsFilter(): JsonFilter {
|
||||
return JsonFilter(
|
||||
kinds = listOf(ReportEvent.kind),
|
||||
authors = listOf(account.userProfile().pubkeyHex)
|
||||
)
|
||||
}
|
||||
|
||||
fun createNotificationFilter() = JsonFilter(
|
||||
tags = mapOf("p" to listOf(account.userProfile().pubkeyHex)),
|
||||
limit = 200
|
||||
@ -50,7 +58,8 @@ object NostrAccountDataSource: NostrDataSource<Note>("AccountData") {
|
||||
accountChannel.filter = listOf(
|
||||
createAccountMetadataFilter(),
|
||||
createAccountContactListFilter(),
|
||||
createNotificationFilter()
|
||||
createNotificationFilter(),
|
||||
createAccountReportsFilter()
|
||||
).ifEmpty { null }
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user