Automatic moderation (#875)

* Automatic moderation

* finish

* modpack fixes

* fix unknown license msg

* fix moderation issues
This commit is contained in:
Geometrically
2024-02-21 16:24:21 -07:00
committed by GitHub
parent 33b2a94d90
commit 04d834187b
43 changed files with 1597 additions and 158 deletions

View File

@@ -379,6 +379,7 @@ pub async fn thread_send_message(
body,
replying_to,
private,
hide_identity,
..
} = &new_message.body
{
@@ -394,6 +395,12 @@ pub async fn thread_send_message(
));
}
if *hide_identity && !user.role.is_mod() {
return Err(ApiError::InvalidInput(
"You are not allowed to send masked messages!".to_string(),
));
}
if let Some(replying_to) = replying_to {
let thread_message =
database::models::ThreadMessage::get((*replying_to).into(), &**pool).await?;