From 8f462ed3a201150e083be3a64463fb9ea83708c6 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 3 Nov 2021 12:21:25 -0400 Subject: [PATCH] Revert "Refactoring delete apub." This reverts commit ba2c3d06cfb870efe792f4b2541036265b425156. --- crates/apub/src/objects/comment.rs | 4 +--- crates/apub/src/objects/community.rs | 6 ++---- crates/apub/src/objects/post.rs | 6 ++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/crates/apub/src/objects/comment.rs b/crates/apub/src/objects/comment.rs index b957bc272..08a55bf9c 100644 --- a/crates/apub/src/objects/comment.rs +++ b/crates/apub/src/objects/comment.rs @@ -24,7 +24,7 @@ use lemmy_utils::{ utils::{convert_datetime, remove_slurs}, LemmyError, }; -use lemmy_websocket::{send::send_comment_ws_message_simple, LemmyContext, UserOperationCrud}; +use lemmy_websocket::LemmyContext; use crate::{ activities::verify_person_in_community, @@ -82,12 +82,10 @@ impl ApubObject for ApubComment { async fn delete(self, context: &LemmyContext) -> Result<(), LemmyError> { if !self.deleted { - let id = self.id; blocking(context.pool(), move |conn| { Comment::update_deleted(conn, self.id, true) }) .await??; - send_comment_ws_message_simple(id, UserOperationCrud::DeleteComment, context).await?; } Ok(()) } diff --git a/crates/apub/src/objects/community.rs b/crates/apub/src/objects/community.rs index dc5774b9a..0947ebf37 100644 --- a/crates/apub/src/objects/community.rs +++ b/crates/apub/src/objects/community.rs @@ -31,7 +31,7 @@ use lemmy_utils::{ utils::{convert_datetime, markdown_to_html}, LemmyError, }; -use lemmy_websocket::{send::send_community_ws_message, LemmyContext, UserOperationCrud}; +use lemmy_websocket::LemmyContext; #[derive(Clone, Debug)] pub struct ApubCommunity(Community); @@ -73,12 +73,10 @@ impl ApubObject for ApubCommunity { } async fn delete(self, context: &LemmyContext) -> Result<(), LemmyError> { - let id = self.id; blocking(context.pool(), move |conn| { - Community::update_deleted(conn, id, true) + Community::update_deleted(conn, self.id, true) }) .await??; - send_community_ws_message(id, UserOperationCrud::DeleteCommunity, None, None, context).await?; Ok(()) } diff --git a/crates/apub/src/objects/post.rs b/crates/apub/src/objects/post.rs index d35fad08b..b835f812e 100644 --- a/crates/apub/src/objects/post.rs +++ b/crates/apub/src/objects/post.rs @@ -32,7 +32,7 @@ use lemmy_utils::{ utils::{convert_datetime, markdown_to_html, remove_slurs}, LemmyError, }; -use lemmy_websocket::{send::send_post_ws_message, LemmyContext, UserOperationCrud}; +use lemmy_websocket::LemmyContext; use std::ops::Deref; use url::Url; @@ -77,12 +77,10 @@ impl ApubObject for ApubPost { async fn delete(self, context: &LemmyContext) -> Result<(), LemmyError> { if !self.deleted { - let id = self.id; blocking(context.pool(), move |conn| { - Post::update_deleted(conn, id, true) + Post::update_deleted(conn, self.id, true) }) .await??; - send_post_ws_message(id, UserOperationCrud::DeletePost, None, None, context).await?; } Ok(()) }