- let content_slurs_removed = remove_slurs(&data.content, &context.settings().slur_regex());
- let private_message_id = data.private_message_id;
- let updated_private_message = blocking(context.pool(), move |conn| {
- PrivateMessage::update_content(conn, private_message_id, &content_slurs_removed)
- })
- .await?
- .map_err(LemmyError::from)
- .map_err(|e| e.with_message("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)?;