]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/objects/comment.rs
Check if post or comment are deleted first. Fixes #1864 (#1867)
[lemmy.git] / crates / apub / src / objects / comment.rs
index e5ffb7ca2e8269012626a8962ab1150119d6075c..08a55bf9cd8bdbd603bcaa89be4b41f0f578ca16 100644 (file)
@@ -81,10 +81,12 @@ impl ApubObject for ApubComment {
   }
 
   async fn delete(self, context: &LemmyContext) -> Result<(), LemmyError> {
-    blocking(context.pool(), move |conn| {
-      Comment::update_deleted(conn, self.id, true)
-    })
-    .await??;
+    if !self.deleted {
+      blocking(context.pool(), move |conn| {
+        Comment::update_deleted(conn, self.id, true)
+      })
+      .await??;
+    }
     Ok(())
   }