feat: apply web of trust filter to thread replies

The WoT filter was already silently dropping events at EventRepository
ingestion and in NotificationRepository, but thread replies bypassed
both paths — ThreadViewModel keeps its own threadEvents map seeded via
cacheEvent() and getCachedThreadEvents(), neither of which checks WoT.

Apply isWotFiltered in rebuildTree() alongside the existing block /
mute / spam filters. The root note is always shown (user explicitly
navigated to it); replies from authors outside the qualified network
are silently dropped, matching how WoT behaves in the feed and
notifications.
This commit is contained in:
Barry Deen
2026-06-05 17:09:30 -04:00
parent a7020603d2
commit 198313e6b3
2 changed files with 2 additions and 1 deletions
@@ -313,7 +313,7 @@ class EventRepository(val profileRepo: ProfileRepository? = null, val muteRepo:
private val WOT_EXEMPT_KINDS = intArrayOf(0, 3, 4, 10002, 10050, 1059, 13, 14)
private fun isWotFiltered(pubkey: String, kind: Int): Boolean {
fun isWotFiltered(pubkey: String, kind: Int): Boolean {
if (safetyPrefs?.wotFilterEnabled?.value != true) return false
val netRepo = extendedNetworkRepo ?: return false
if (!netRepo.isNetworkReady()) return false
@@ -434,6 +434,7 @@ class ThreadViewModel : ViewModel() {
if (deletedRepo?.isDeleted(event.id) == true) continue
if (muteRepo?.isBlocked(event.pubkey) == true) continue
if (Nip10.isStandaloneQuote(event)) continue
if (eventRepoRef?.isWotFiltered(event.pubkey, event.kind) == true) continue
if (spamEnabled && spamClassifier != null &&
event.pubkey != currentUserPubkey &&