UGC_COMPLIANCE_PLAN.md (6313B)
1 # Google Play Store UGC Compliance Plan for notedeck_columns 2 3 ## Overview 4 5 Implement User Generated Content (UGC) compliance features required by Google Play Store for the notedeck_columns Nostr client app. 6 7 ## Current State 8 9 - **Has**: Client-side muting (pubkeys, hashtags, threads), blurhash media obfuscation for non-followed users 10 - **Missing**: TOS acceptance, user blocking, content reporting, age verification 11 12 ## Requirements from Google Play 13 14 1. TOS acceptance before UGC creation 15 2. Define objectionable content in TOS 16 3. In-app reporting system for users and content 17 4. User blocking functionality (required for DM/mention features) 18 19 --- 20 21 ## Implementation Plan 22 23 ### Phase 1: Data Structures & Storage 24 25 **1.1 Create compliance module** - `crates/notedeck/src/compliance.rs` 26 ```rust 27 pub struct ComplianceData { 28 pub tos_accepted: bool, 29 pub tos_accepted_at: Option<u64>, 30 pub tos_version: String, // e.g., "1.0" 31 pub age_verified: bool, 32 } 33 ``` 34 35 **1.2 Add blocked users to Muted** - `crates/notedeck/src/muted.rs` 36 - Add `blocked_pubkeys: BTreeSet<[u8; 32]>` field 37 - Add `is_blocked(pk)` method 38 - Blocked = completely hidden (stronger than muted) 39 40 **1.3 Extend Settings** - `crates/notedeck/src/persist/settings_handler.rs` 41 - Add `tos_accepted`, `tos_accepted_at`, `tos_version`, `age_verified` fields 42 - Add `blocked_pubkeys` (or store per-account) 43 44 ### Phase 2: TOS & Age Verification Screen 45 46 **2.1 Create TOS route** - `crates/notedeck_columns/src/route.rs` 47 - Add `Route::TosAcceptance` 48 49 **2.2 Create TOS UI** - `crates/notedeck_columns/src/ui/side_panel/tos.rs` (new) 50 - Full-screen modal with: 51 - Scrollable TOS text (embedded, you provide content) 52 - Checkbox: "I confirm I am 17 years or older" 53 - Checkbox: "I agree to the Terms of Service and Community Guidelines" 54 - "Accept and Continue" button (disabled until both checked) 55 56 **2.3 Gate UGC creation** 57 - Modify `crates/notedeck_columns/src/ui/note/post.rs` - check TOS before post 58 - Modify note reply flow - check TOS before reply 59 - Modify `crates/notedeck_messages/` - check TOS before DM 60 61 **2.4 Trigger on first launch** 62 - In app startup, if `!settings.tos_accepted`, show TOS screen before main UI 63 64 ### Phase 3: Block User Feature 65 66 **3.1 Add block to context menus** 67 - `crates/notedeck_ui/src/note/context.rs` - add `BlockAuthor` option 68 - `crates/notedeck_ui/src/profile/context.rs` - add `Block` option 69 70 **3.2 Block confirmation dialog** - `crates/notedeck_columns/src/ui/side_panel/block.rs` (new) 71 - "Block @username?" 72 - "You won't see their posts, replies, or messages" 73 - Block / Cancel buttons 74 75 **3.3 Filter blocked content** 76 - Modify timeline rendering to skip blocked pubkeys 77 - Modify DM conversation list to hide blocked users 78 - Modify notification filtering 79 80 **3.4 Blocked users management** 81 - Add to Settings UI: "Blocked Users" section with list and unblock option 82 83 ### Phase 4: Report Feature (NIP-56) 84 85 **4.1 Create report event builder** - `crates/enostr/src/report.rs` (new) 86 ```rust 87 // NIP-56 Report Event (kind 1984) 88 pub fn create_report_note(note_id, author_pk, reason) -> NostrEvent 89 pub fn create_report_profile(pubkey, reason) -> NostrEvent 90 ``` 91 92 Reasons (NIP-56): `nudity`, `malware`, `profanity`, `illegal`, `spam`, `impersonation`, `other` 93 94 **4.2 Add report to context menus** 95 - Note context menu: "Report Note" 96 - Profile context menu: "Report User" 97 98 **4.3 Report dialog UI** - `crates/notedeck_columns/src/ui/side_panel/report.rs` (new) 99 - Select reason (dropdown/radio) 100 - Optional description text 101 - Submit / Cancel buttons 102 - On submit: sign and publish NIP-56 event to relays 103 104 ### Phase 5: Settings Integration 105 106 **5.1 Add "Content & Safety" section** to `crates/notedeck_columns/src/ui/settings.rs` 107 - Blocked Users (list with unblock) 108 - Muted Users (existing, but surface here too) 109 - View Terms of Service 110 - Content filtering toggle (hide sensitive media by default) 111 112 --- 113 114 ## Key Files to Modify 115 116 | File | Changes | 117 |------|---------| 118 | `crates/notedeck/src/muted.rs` | Add `blocked_pubkeys`, `is_blocked()` | 119 | `crates/notedeck/src/persist/settings_handler.rs` | Add TOS/compliance fields | 120 | `crates/notedeck_columns/src/route.rs` | Add TOS, Report, BlockConfirm routes | 121 | `crates/notedeck_ui/src/note/context.rs` | Add Block/Report menu options | 122 | `crates/notedeck_ui/src/profile/context.rs` | Add Block/Report menu options | 123 | `crates/notedeck_columns/src/ui/settings.rs` | Add Content & Safety section | 124 | `crates/notedeck_columns/src/ui/note/post.rs` | Gate posting behind TOS | 125 126 ## New Files to Create 127 128 | File | Purpose | 129 |------|---------| 130 | `crates/notedeck/src/compliance.rs` | ComplianceData struct | 131 | `crates/notedeck_columns/src/ui/side_panel/tos.rs` | TOS acceptance screen | 132 | `crates/notedeck_columns/src/ui/side_panel/block.rs` | Block confirmation dialog | 133 | `crates/notedeck_columns/src/ui/side_panel/report.rs` | Report dialog | 134 | `crates/enostr/src/report.rs` | NIP-56 report event creation | 135 136 --- 137 138 ## TOS Content Requirements 139 140 The embedded TOS must define prohibited content (per Google Play): 141 - Illegal content 142 - Child sexual abuse material 143 - Harassment and bullying 144 - Hate speech and discrimination 145 - Impersonation 146 - Malware, phishing, spam 147 - Sexually explicit content (note: Nostr is decentralized, explain user's responsibility) 148 149 Include: 150 - Age requirement (17+) 151 - How to report content 152 - How to block users 153 - Disclaimer: decentralized protocol means content cannot be deleted from all relays 154 155 **You will need to provide the actual TOS text.** 156 157 --- 158 159 ## Verification 160 161 After implementation: 162 1. Fresh install → TOS screen appears before main UI 163 2. Cannot post/reply/DM until TOS accepted 164 3. Block user from note → user's content disappears from timelines 165 4. Block user from profile → same result 166 5. Report note → NIP-56 event published to relays (check with relay or other client) 167 6. Report profile → NIP-56 event published 168 7. Blocked users visible in Settings, can unblock 169 8. App restart → blocked users remain blocked, TOS remains accepted 170 171 --- 172 173 ## Out of Scope (Nostr Protocol Limitations) 174 175 - Cannot delete content from relays (decentralized) 176 - Cannot prevent blocked users from seeing your content 177 - Cannot implement server-side moderation 178 - Reports are informational (relays/clients may or may not act on them) 179 180 These limitations should be disclosed in the TOS.