]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/activities/comment/create_or_update.rs
Rewrite activitypub following, person, community, pm (#1692)
[lemmy.git] / crates / apub / src / activities / comment / create_or_update.rs
index 4cafafbaaf3296a7c821a50489024cd87b2faf82..bfc1b7fe6d4544ed63f85b4a032a5b91d200d689 100644 (file)
@@ -96,7 +96,7 @@ impl ActivityHandler for CreateOrUpdateComment {
       request_counter,
     )
     .await?;
-    verify_domains_match(&self.common.actor, &self.object.id)?;
+    verify_domains_match(&self.common.actor, self.object.id_unchecked())?;
     // TODO: should add a check that the correct community is in cc (probably needs changes to
     //       comment deserialization)
     self.object.verify(context, request_counter).await?;
@@ -104,18 +104,12 @@ impl ActivityHandler for CreateOrUpdateComment {
   }
 
   async fn receive(
-    &self,
+    self,
     context: &LemmyContext,
     request_counter: &mut i32,
   ) -> Result<(), LemmyError> {
-    let comment = Comment::from_apub(
-      &self.object,
-      context,
-      self.common.actor.clone(),
-      request_counter,
-      false,
-    )
-    .await?;
+    let comment =
+      Comment::from_apub(&self.object, context, &self.common.actor, request_counter).await?;
     let recipients =
       get_notif_recipients(&self.common.actor, &comment, context, request_counter).await?;
     let notif_type = match self.kind {