- // apub updates
- let community = blocking(context.pool(), move |conn| {
- Community::read(conn, orig_post.community_id)
- })
- .await??;
- let deletable = DeletableObjects::Post(Box::new(updated_post.into()));
- send_apub_delete_in_community(
- local_user_view.person,
- community,
- deletable,
- data.reason.clone().or_else(|| Some("".to_string())),
- removed,
- context,
- )
- .await?;
- Ok(res)
- }
+ // Mod tables
+ let form = ModRemovePostForm {
+ mod_person_id: local_user_view.person.id,
+ post_id: data.post_id,
+ removed: Some(removed),
+ reason: data.reason.clone(),
+ };
+ ModRemovePost::create(&mut context.pool(), &form).await?;
+
+ let person_id = local_user_view.person.id;
+ ActivityChannel::submit_activity(
+ SendActivityData::RemovePost(post, local_user_view.person, data.0),
+ &context,
+ )
+ .await?;
+
+ build_post_response(&context, orig_post.community_id, person_id, post_id).await