deletion::{receive_delete_action, verify_delete_activity, DeletableObjects},
generate_activity_id,
},
- insert_activity,
+ insert_received_activity,
objects::person::ApubPerson,
protocol::{activities::deletion::delete::Delete, IdOrNestedObject},
};
#[tracing::instrument(skip_all)]
async fn verify(&self, context: &Data<Self::DataType>) -> Result<(), LemmyError> {
+ insert_received_activity(&self.id, context).await?;
verify_delete_activity(self, self.summary.is_some(), context).await?;
Ok(())
}
#[tracing::instrument(skip_all)]
async fn receive(self, context: &Data<LemmyContext>) -> Result<(), LemmyError> {
- insert_activity(&self.id, &self, false, false, context).await?;
if let Some(reason) = self.summary {
// We set reason to empty string if it doesn't exist, to distinguish between delete and
// remove. Here we change it back to option, so we don't write it to db.
reason,
expires: None,
};
- ModRemoveCommunity::create(context.pool(), &form).await?;
+ ModRemoveCommunity::create(&mut context.pool(), &form).await?;
Community::update(
- context.pool(),
+ &mut context.pool(),
community.id,
&CommunityUpdateForm::builder().removed(Some(true)).build(),
)
removed: Some(true),
reason,
};
- ModRemovePost::create(context.pool(), &form).await?;
+ ModRemovePost::create(&mut context.pool(), &form).await?;
Post::update(
- context.pool(),
+ &mut context.pool(),
post.id,
&PostUpdateForm::builder().removed(Some(true)).build(),
)
removed: Some(true),
reason,
};
- ModRemoveComment::create(context.pool(), &form).await?;
+ ModRemoveComment::create(&mut context.pool(), &form).await?;
Comment::update(
- context.pool(),
+ &mut context.pool(),
comment.id,
&CommentUpdateForm::builder().removed(Some(true)).build(),
)