Skip to content

feat: Web of Trust global content filter#456

Merged
barrydeen merged 1 commit intomainfrom
feat/wot-filter
Apr 16, 2026
Merged

feat: Web of Trust global content filter#456
barrydeen merged 1 commit intomainfrom
feat/wot-filter

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • When Web of Trust is enabled in Settings → Safety → Filters, events from pubkeys outside the user's qualified social graph are dropped globally
  • The qualified set = user's own pubkey + first-degree follows + extended network pubkeys (computed via the existing Social Graph screen)
  • Filtering applies to all event types: notes (kind 1), reactions (kind 7), zaps (kind 9735, checked against zapper pubkey), and reposts (kind 6, checked against both reposter and inner author)
  • Exempt kinds: profiles (0), contact lists (3), relay lists (10002), DM-related kinds (4, 1059, 13, 14), DM relay lists (10050) — these always pass through
  • Fail-open: filter is inactive when the social graph hasn't been computed or is stale
  • Toggling the filter triggers an immediate feed rebuild from cache
  • Filter also applies at the notification ingestion layer

Modified files

File Change
EventRepository.kt Added isWotFiltered() helper; WoT check in addEvent(), addReaction(), zap path, repost path, and rebuildFeedFromCache()
NotificationRepository.kt WoT check in addEvent() for notifications
FeedViewModel.kt Wire safetyPrefs and extendedNetworkRepo into EventRepository and NotificationRepository
SafetyFiltersTab.kt Added onWotToggled callback when WoT switch is toggled
SafetyScreen.kt Pass through onWotToggled
Navigation.kt Wire onWotToggledrebuildFeedFromCache()

Test plan

  • Without computing social graph, enable WoT → feed still shows everything (fail-open), Filters tab shows "Social graph not computed" warning
  • Compute social graph (Drawer → Social Graph → Compute)
  • Enable WoT → feed collapses to only qualified-network authors; reaction counts and zap amounts drop to only in-network engagement
  • Disable WoT → everything reappears without restart
  • Follow a previously-hidden account → their content appears immediately (follows are always in-network)
  • DMs from out-of-network accounts still arrive
  • Notifications from out-of-network accounts are filtered when WoT is on

When enabled in Settings → Safety → Filters, events from pubkeys
outside the user's qualified social graph (self + follows + extended
network) are silently dropped at the EventRepository and
NotificationRepository ingestion layer. This covers notes, reactions,
zaps, and reposts.

Exempt kinds: profiles (0), contact lists (3), relay lists (10002),
DM-related kinds (4, 1059, 13, 14), and DM relay lists (10050).
The filter fails open when the social graph is not computed or stale.
Toggling the filter triggers an immediate feed rebuild.
@barrydeen barrydeen merged commit 14abc62 into main Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant