use crate::PerformCrud;
use actix_web::web::Data;
use lemmy_api_common::{
- blocking,
- get_local_user_view_from_jwt,
- person::{DeletePrivateMessage, PrivateMessageResponse},
+ private_message::{DeletePrivateMessage, PrivateMessageResponse},
+ utils::{blocking, get_local_user_view_from_jwt},
};
use lemmy_apub::activities::deletion::send_apub_delete_private_message;
use lemmy_db_schema::{source::private_message::PrivateMessage, traits::Crud};
-use lemmy_utils::{ConnectionId, LemmyError};
+use lemmy_utils::{error::LemmyError, ConnectionId};
use lemmy_websocket::{send::send_pm_ws_message, LemmyContext, UserOperationCrud};
#[async_trait::async_trait(?Send)]
PrivateMessage::update_deleted(conn, private_message_id, deleted)
})
.await?
- .map_err(LemmyError::from)
- .map_err(|e| e.with_message("couldnt_update_private_message"))?;
+ .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_private_message"))?;
// Send the apub update
send_apub_delete_private_message(