- let content_slurs_removed = remove_slurs(&data.content, &local_site_to_slur_regex(&local_site));
- let private_message_id = data.private_message_id;
- let updated_private_message = blocking(context.pool(), move |conn| {
- PrivateMessage::update(
- conn,
- private_message_id,
- &PrivateMessageUpdateForm::builder()
- .content(Some(content_slurs_removed))
- .updated(Some(Some(naive_now())))
- .build(),
- )
- })
- .await?
- .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_private_message"))?;
+ let content = sanitize_html(&data.content);
+ let content = remove_slurs(&content, &local_site_to_slur_regex(&local_site));
+ is_valid_body_field(&Some(content.clone()), false)?;