- let updated_private_message = blocking(
- context.pool(),
- move |conn| -> Result<PrivateMessage, LemmyError> {
- let apub_id = generate_local_apub_endpoint(
- EndpointType::PrivateMessage,
- &inserted_private_message_id.to_string(),
- &protocol_and_hostname,
- )?;
- Ok(PrivateMessage::update_ap_id(
- conn,
- inserted_private_message_id,
- apub_id,
- )?)
- },
- )
- .await?
- .map_err(|e| ApiError::err("couldnt_create_private_message", e))?;
-
- CreateOrUpdatePrivateMessage::send(
- updated_private_message.into(),
- &local_user_view.person.into(),
- CreateOrUpdateType::Create,
- context,
- )
- .await?;
-
- let res = send_pm_ws_message(
+ let apub_id = generate_local_apub_endpoint(
+ EndpointType::PrivateMessage,
+ &inserted_private_message_id.to_string(),
+ &protocol_and_hostname,
+ )?;
+ PrivateMessage::update(
+ &mut context.pool(),