-
-#[async_trait::async_trait(?Send)]
-impl GetCommunity for Vote {
- async fn get_community(
- &self,
- context: &LemmyContext,
- request_counter: &mut i32,
- ) -> Result<ApubCommunity, LemmyError> {
- let object = self.object.dereference(context, request_counter).await?;
- let cid = match object {
- PostOrComment::Post(p) => p.community_id,
- PostOrComment::Comment(c) => {
- blocking(context.pool(), move |conn| Post::read(conn, c.post_id))
- .await??
- .community_id
- }
- };
- let community = blocking(context.pool(), move |conn| Community::read(conn, cid)).await??;
- Ok(community.into())
- }
-}