feat(safety): report, block and hide chat lines (MODULE_API 1.21.0) #72
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/user-safety"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
Step 3 of
docs/website/USER_SAFETY.md(account-deletion step 7): the module half of report, block and hide. Core shipped its half in website#233. This PR makes Rust chat lines reportable, hideable and blockable, as §4.2 and S11-S14 describe.Server
server/safety.jsholds all of it:rust.chatreport target.snapshotanswers for one reader and returnsnullwhen they couldn't have seen the line: a server whose presence is hidden from them, or a line staff hid when the reader isn't staff.hideandunhideare staff's hide for everyone.steamgame identity.ownersOfreadsrust_account_links.The events feed filters chat per reader, in the SQL, so a page of 100 is still 100 long. It leaves out:
Only
player.chatrows are filtered: a blocked player's deaths and connects stay in the feed. Signed-in readers getcanBlockon each chat line. It's false on their own lines and on lines from staff-linked players.Hide for everyone:
rust_eventsgainshidden_atandhidden_by, added withALTER … ADD COLUMN IF NOT EXISTS.hidden: true.POST /admin/rust/chat/:id/hideand/unhide, for admins and moderators. Both are written to the activity log.If core's safety read fails, the feed is served unfiltered with a warning in the log rather than failing. If the staff lookup fails, every line gets
canBlock: false.coreApiis^1.21.0.ci/core-ref.jsonis pinned to the website#233 merge (f13b8fe).routes.manifest.jsonandswagger-fragment.jsonare regenerated, andci/bundle.jsonnow shipssafety.js.Client
components/ChatMenu.jsx: a⋯at the end of each chat line in the feed.canBlockis true. Block asks for confirmation first.Docs: RunicGateway/docs
docs/user-safety-rust. Kit: RunicGateway/Integration-kitdocs/core-1.21.0.How it was tested
npm testinserver: 750 tests, 0 failing. Includes the newtest/safety.test.js.check:imports,check:bundle,check:swaggerandcheck:engagementare all OK.client:npm run build,npm test(107 tests, 0 failing) andcheck:externalsall pass.f13b8fe, the same way CI does it.--checkpasses: 91 routes, all documented, none of core's moved.usafety3on the local MariaDB, a core on:3293with this branch's module installed, chat lines and Steam links written straight into the tables. 28 API rows over bearer logins, all passing:canBlock.canBlockwas correct for unlinked, linked, own and moderator lines.staff.Checklist
AI-assisted contributions (required)
Claude Code (Claude Opus 5.5). I have reviewed and understandevery change, and take responsibility for it. AI-authored commits are
marked with a
Co-Authored-By/Assisted-Bytrailer.License
(GNU GPL v3.0 or later), and I have the right to contribute it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY