Files
Synapsis/src/lib/nsfw/feed-access.ts
T
cyph3rasi e1a7f5018f Show NSFW-node posts to authenticated local members in Curated and Swarm feeds
Hop-State: A_06FP9V8EJ8CX3VM4D7DDZJR
Hop-Proposal: R_06FP9V7H6GNGX6CFBQN8HER
Hop-Task: T_06FP9TA4HBBMJPF6SDEMEC0
Hop-Attempt: AT_06FP9TA4HBQJXX3KT14FYN0
2026-07-15 01:38:05 -07:00

18 lines
464 B
TypeScript

export interface NsfwFeedViewer {
nsfwEnabled?: boolean;
}
export function shouldIncludeNsfwFeed({
viewer,
localNodeIsNsfw,
}: {
viewer: NsfwFeedViewer | null;
localNodeIsNsfw: boolean;
}): boolean {
if (!viewer) return false;
// Signing in to an NSFW node is consent to view its feed. On other nodes,
// the viewer's explicit account preference remains authoritative.
return localNodeIsNsfw || viewer.nsfwEnabled === true;
}