let local_user_view =
get_local_user_view_from_jwt(&request.auth, context.pool(), context.secret()).await?;
let community = Community::read(context.pool(), response.post_view.community.id).await?;
- let deletable = DeletableObjects::Post(Box::new(response.post_view.post.clone().into()));
+ let deletable = DeletableObjects::Post(response.post_view.post.clone().into());
send_apub_delete_in_community(
local_user_view.person,
community,
let local_user_view =
get_local_user_view_from_jwt(&request.auth, context.pool(), context.secret()).await?;
let community = Community::read(context.pool(), response.post_view.community.id).await?;
- let deletable = DeletableObjects::Post(Box::new(response.post_view.post.clone().into()));
+ let deletable = DeletableObjects::Post(response.post_view.post.clone().into());
send_apub_delete_in_community(
local_user_view.person,
community,
let community_id = response.comment_view.community.id;
let community = Community::read(context.pool(), community_id).await?;
let person = Person::read(context.pool(), response.comment_view.creator.id).await?;
- let deletable =
- DeletableObjects::Comment(Box::new(response.comment_view.comment.clone().into()));
+ let deletable = DeletableObjects::Comment(response.comment_view.comment.clone().into());
send_apub_delete_in_community(person, community, deletable, None, request.deleted, context)
.await
}
get_local_user_view_from_jwt(&request.auth, context.pool(), context.secret()).await?;
let comment = Comment::read(context.pool(), request.comment_id).await?;
let community = Community::read(context.pool(), response.comment_view.community.id).await?;
- let deletable = DeletableObjects::Comment(Box::new(comment.into()));
+ let deletable = DeletableObjects::Comment(comment.into());
send_apub_delete_in_community(
local_user_view.person,
community,
let local_user_view =
get_local_user_view_from_jwt(&request.auth, context.pool(), context.secret()).await?;
let community = Community::read(context.pool(), request.community_id).await?;
- let deletable = DeletableObjects::Community(Box::new(community.clone().into()));
+ let deletable = DeletableObjects::Community(community.clone().into());
send_apub_delete_in_community(
local_user_view.person,
community,
let local_user_view =
get_local_user_view_from_jwt(&request.auth, context.pool(), context.secret()).await?;
let community = Community::read(context.pool(), request.community_id).await?;
- let deletable = DeletableObjects::Community(Box::new(community.clone().into()));
+ let deletable = DeletableObjects::Community(community.clone().into());
send_apub_delete_in_community(
local_user_view.person,
community,
let recipient_id = pm.recipient_id;
let recipient: ApubPerson = Person::read(context.pool(), recipient_id).await?.into();
- let deletable = DeletableObjects::PrivateMessage(Box::new(pm.into()));
+ let deletable = DeletableObjects::PrivateMessage(pm.into());
let inbox = vec![recipient.shared_inbox_or_inbox()];
if deleted {
let delete = Delete::new(actor, deletable, recipient.actor_id(), None, None, context)?;
}
pub enum DeletableObjects {
- Community(Box<ApubCommunity>),
- Comment(Box<ApubComment>),
- Post(Box<ApubPost>),
- PrivateMessage(Box<ApubPrivateMessage>),
+ Community(ApubCommunity),
+ Comment(ApubComment),
+ Post(ApubPost),
+ PrivateMessage(ApubPrivateMessage),
}
impl DeletableObjects {
context: &LemmyContext,
) -> Result<DeletableObjects, LemmyError> {
if let Some(c) = ApubCommunity::read_from_apub_id(ap_id.clone(), context).await? {
- return Ok(DeletableObjects::Community(Box::new(c)));
+ return Ok(DeletableObjects::Community(c));
}
if let Some(p) = ApubPost::read_from_apub_id(ap_id.clone(), context).await? {
- return Ok(DeletableObjects::Post(Box::new(p)));
+ return Ok(DeletableObjects::Post(p));
}
if let Some(c) = ApubComment::read_from_apub_id(ap_id.clone(), context).await? {
- return Ok(DeletableObjects::Comment(Box::new(c)));
+ return Ok(DeletableObjects::Comment(c));
}
if let Some(p) = ApubPrivateMessage::read_from_apub_id(ap_id.clone(), context).await? {
- return Ok(DeletableObjects::PrivateMessage(Box::new(p)));
+ return Ok(DeletableObjects::PrivateMessage(p));
}
Err(diesel::NotFound.into())
}