async fn receive(self, context: &Data<Self::DataType>) -> Result<(), LemmyError> {
insert_activity(&self.id, &self, false, false, context).await?;
let (community, collection_type) =
- Community::get_by_collection_url(context.pool(), &self.target.into()).await?;
+ Community::get_by_collection_url(&mut context.pool(), &self.target.into()).await?;
match collection_type {
CollectionType::Moderators => {
let remove_mod = ObjectId::<ApubPerson>::from(self.object)
community_id: community.id,
person_id: remove_mod.id,
};
- CommunityModerator::leave(context.pool(), &form).await?;
+ CommunityModerator::leave(&mut context.pool(), &form).await?;
// write mod log
let actor = self.actor.dereference(context).await?;
community_id: community.id,
removed: Some(true),
};
- ModAddCommunity::create(context.pool(), &form).await?;
+ ModAddCommunity::create(&mut context.pool(), &form).await?;
// TODO: send websocket notification about removed mod
}
let form = PostUpdateForm::builder()
.featured_community(Some(false))
.build();
- Post::update(context.pool(), post.id, &form).await?;
+ Post::update(&mut context.pool(), post.id, &form).await?;
}
}
Ok(())