]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/protocol/activities/deletion/undo_delete.rs
Implement separate mod activities for feature, lock post (#2716)
[lemmy.git] / crates / apub / src / protocol / activities / deletion / undo_delete.rs
index d5249ba9aaa438d2e6156f83f1d67c361613da70..6c584ccf5299862b7a45d6ab5de782ef80d2b02c 100644 (file)
@@ -1,6 +1,5 @@
 use crate::{
   activities::verify_community_matches,
-  local_instance,
   objects::{community::ApubCommunity, person::ApubPerson},
   protocol::{activities::deletion::delete::Delete, InCommunity},
 };
@@ -37,15 +36,10 @@ impl InCommunity for UndoDelete {
     context: &LemmyContext,
     request_counter: &mut i32,
   ) -> Result<ApubCommunity, LemmyError> {
-    let object_community = self.object.community(context, request_counter).await?;
+    let community = self.object.community(context, request_counter).await?;
     if let Some(audience) = &self.audience {
-      let audience = audience
-        .dereference(context, local_instance(context).await, request_counter)
-        .await?;
-      verify_community_matches(&audience, object_community.id)?;
-      Ok(audience)
-    } else {
-      Ok(object_community)
+      verify_community_matches(audience, community.actor_id.clone())?;
     }
+    Ok(community)
   }
 }