- 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(),
- &protocol_and_hostname,
- )?;
- Ok(Comment::update_ap_id(conn, inserted_comment_id, apub_id)?)
- })
- .await?
- .map_err(|e| ApiError::err("couldnt_create_comment", e))?;
-
- CreateOrUpdateComment::send(
- &updated_comment,
- &local_user_view.person,
- CreateOrUpdateType::Create,
- context,
+ let apub_id = generate_local_apub_endpoint(
+ EndpointType::Comment,
+ &inserted_comment_id.to_string(),
+ &protocol_and_hostname,
+ )?;
+ let updated_comment = Comment::update(
+ &mut context.pool(),
+ inserted_comment_id,
+ &CommentUpdateForm::builder().ap_id(Some(apub_id)).build(),