]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/protocol/objects/note.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / apub / src / protocol / objects / note.rs
index de90636e669e9045904d80b40693a5e547fe38bd..f594c14e4124dd5999d1a436efcab6352772b8e3 100644 (file)
@@ -64,7 +64,7 @@ impl Note {
       PostOrComment::Post(p) => Ok((p.clone(), None)),
       PostOrComment::Comment(c) => {
         let post_id = c.post_id;
-        let post = Post::read(context.pool(), post_id).await?;
+        let post = Post::read(&mut context.pool(), post_id).await?;
         Ok((post.into(), Some(c.clone())))
       }
     }
@@ -75,7 +75,7 @@ impl Note {
 impl InCommunity for Note {
   async fn community(&self, context: &Data<LemmyContext>) -> Result<ApubCommunity, LemmyError> {
     let (post, _) = self.get_parents(context).await?;
-    let community = Community::read(context.pool(), post.community_id).await?;
+    let community = Community::read(&mut context.pool(), post.community_id).await?;
     if let Some(audience) = &self.audience {
       verify_community_matches(audience, community.actor_id.clone())?;
     }