You've already forked pages
forked from didirus/AstralRinth
Automatic moderation (#875)
* Automatic moderation * finish * modpack fixes * fix unknown license msg * fix moderation issues
This commit is contained in:
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user