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