websocket_id: Option<ConnectionId>,
) -> Result<CommentResponse, LemmyError> {
let data: &CreateComment = self;
- let local_user_view = get_local_user_view_from_jwt(&data.auth, context.pool()).await?;
+ let local_user_view =
+ get_local_user_view_from_jwt(&data.auth, context.pool(), context.secret()).await?;
- let content_slurs_removed = remove_slurs(&data.content.to_owned());
+ let content_slurs_removed =
+ remove_slurs(&data.content.to_owned(), &context.settings().slur_regex());
// Check for a community ban
let post_id = data.post_id;
// Necessary to update the ap_id
let inserted_comment_id = inserted_comment.id;
+ let protocol_and_hostname = context.settings().get_protocol_and_hostname();
+
let updated_comment: Comment =
blocking(context.pool(), move |conn| -> Result<Comment, LemmyError> {
- let apub_id =
- generate_apub_endpoint(EndpointType::Comment, &inserted_comment_id.to_string())?;
+ let apub_id = generate_apub_endpoint(
+ EndpointType::Comment,
+ &inserted_comment_id.to_string(),
+ &protocol_and_hostname,
+ )?;
Ok(Comment::update_ap_id(conn, inserted_comment_id, apub_id)?)
})
.await?
post,
context.pool(),
true,
+ &context.settings(),
)
.await?;