Moderation follow-ups: block on contact profile, z-index, account suspend, reporter notify
Addresses tester feedback on the Report/Block feature: 1. Block/Unblock is now on the CONTACT's profile card (openMiniProfile), not only in a message's ⋮/long-press menu — you can block someone straight from their info popup. 2. Admin Delete/confirm popups were appearing BEHIND the Reports window. The moderation modals used z-index 100000 (above bzConfirm's .modal-ov at 9800); lowered them to 9750 so the confirm dialog sits on top. 3. Clarified admin action. "Block" is a PERSONAL mute (per guideline 1.2) and does not touch login. The report view now offers a real account action instead: "Suspend account" (deactivate -> signed out + cannot log in) with a confirm, toggling to "Reactivate account" — both reversible in-place, driven by a new reportedActive flag on /api/reports. (Uses the existing /api/users/manage deactivate/activate.) 4. Resolving a report now notifies the reporter (live 'report-resolved' event + background push), and admins get a 'report-new' activity entry. repos: reports.byId. Verified: moderation suite 18/18 (adds reportedActive + suspend->login-blocked->reactivate->login-restored). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -442,6 +442,7 @@ const reports = {
|
||||
add: ({ id, teamId, messageId, reporterId, reportedId, reason, snippet }) =>
|
||||
db.prepare('INSERT INTO message_reports (id,team_id,message_id,reporter_id,reported_id,reason,snippet,created_at,status) VALUES (?,?,?,?,?,?,?,?,?)')
|
||||
.run(id, teamId, messageId, reporterId, reportedId, reason || null, snippet || null, now(), 'open'),
|
||||
byId: (id) => db.prepare('SELECT * FROM message_reports WHERE id=?').get(id),
|
||||
listForTeam: (teamId, limit = 200) => db.prepare('SELECT * FROM message_reports WHERE team_id=? ORDER BY created_at DESC LIMIT ?').all(teamId, limit),
|
||||
setStatus: (id, status) => db.prepare('UPDATE message_reports SET status=? WHERE id=?').run(status, id),
|
||||
openCountForTeam: async (teamId) => (await db.prepare("SELECT COUNT(*) AS c FROM message_reports WHERE team_id=? AND status='open'").get(teamId)).c,
|
||||
|
||||
Reference in New Issue
Block a user