X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapub%2Fsrc%2Factivities%2Fcreate_or_update%2Fcomment.rs;h=804f1827bb23a1cc7ade6e0f5a9f5b17961b2ca4;hb=1d38aad9d3d51ef606074d5b49a8030c49dd0e9e;hp=e9e5673355510f1fb4b08c5c759627f651ceb95a;hpb=73492af4b09448684ffde3d55454434ec3ed490b;p=lemmy.git diff --git a/crates/apub/src/activities/create_or_update/comment.rs b/crates/apub/src/activities/create_or_update/comment.rs index e9e56733..804f1827 100644 --- a/crates/apub/src/activities/create_or_update/comment.rs +++ b/crates/apub/src/activities/create_or_update/comment.rs @@ -91,10 +91,12 @@ impl CreateOrUpdateNote { ) -> Result<(), LemmyError> { // TODO: might be helpful to add a comment method to retrieve community directly let post_id = comment.post_id; - let post = Post::read(context.pool(), post_id).await?; + let post = Post::read(&mut context.pool(), post_id).await?; let community_id = post.community_id; - let person: ApubPerson = Person::read(context.pool(), person_id).await?.into(); - let community: ApubCommunity = Community::read(context.pool(), community_id).await?.into(); + let person: ApubPerson = Person::read(&mut context.pool(), person_id).await?.into(); + let community: ApubCommunity = Community::read(&mut context.pool(), community_id) + .await? + .into(); let id = generate_activity_id( kind.clone(), @@ -177,7 +179,7 @@ impl ActivityHandler for CreateOrUpdateNote { if distinguished != existing_comment.distinguished { let creator = self.actor.dereference(context).await?; let (post, _) = self.object.get_parents(context).await?; - is_mod_or_admin(context.pool(), creator.id, post.community_id).await?; + is_mod_or_admin(&mut context.pool(), creator.id, post.community_id).await?; } } @@ -190,14 +192,14 @@ impl ActivityHandler for CreateOrUpdateNote { person_id: comment.creator_id, score: 1, }; - CommentLike::like(context.pool(), &like_form).await?; + CommentLike::like(&mut context.pool(), &like_form).await?; // Calculate initial hot_rank - CommentAggregates::update_hot_rank(context.pool(), comment.id).await?; + CommentAggregates::update_hot_rank(&mut context.pool(), comment.id).await?; let do_send_email = self.kind == CreateOrUpdateType::Create; let post_id = comment.post_id; - let post = Post::read(context.pool(), post_id).await?; + let post = Post::read(&mut context.pool(), post_id).await?; let actor = self.actor.dereference(context).await?; // Note: