Forum: reports for moderators and private messages by request

Any logged-in user can report a post, or a private message received; a
possible crisis shows the helplines at once. Moderators get the open
reports (crisis first) with what was reported, remove or close them, and
every step goes to the log; the operator gets a Telegram notice of each
new report (kind and link only). Private conversations start with a
request and a short introduction (from the Kereső rank, a few a day); the
recipient accepts, declines silently or blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-26 10:48:28 +00:00
co-authored by Claude Opus 5.5
parent 36b38525c3
commit 4def9569b1
28 changed files with 2322 additions and 58 deletions
+11 -1
View File
@@ -172,7 +172,17 @@ async fn followed_counts(state: &St, viewer: &Viewer) -> ApiResult<Option<Value>
/// For the forum's menu on every page: who the viewer is, and the badge.
pub async fn nav(state: St, viewer: Viewer) -> ApiResult<Json<Value>> {
Ok(Json(json!({ "viewer": viewer_json(&viewer), "followed": followed_counts(&state, &viewer).await? })))
let messages = match &viewer.member {
Some(m) => Some(super::messages::unread_count(&state.db, m.user_id).await?),
None => None,
};
let reports = if viewer.is_moderator() { Some(super::reports::open_count(&state.db).await?) } else { None };
Ok(Json(json!({
"viewer": viewer_json(&viewer),
"followed": followed_counts(&state, &viewer).await?,
"messages": messages,
"reports": reports,
})))
}
pub async fn topics(state: St, viewer: Viewer) -> ApiResult<Json<Value>> {