Also read post's community from audience

This commit is contained in:
Felix Ableitner 2024-05-02 15:25:20 +02:00
parent 6ae7a5aebc
commit 3bc61dd40d

View file

@ -243,7 +243,11 @@ impl InCommunity for Page {
break c; break c;
} }
} else { } else {
Err(LemmyErrorType::NoCommunityFoundInCc)? let audience = self
.audience
.clone()
.ok_or(LemmyErrorType::NoCommunityFoundInCc)?;
break audience.dereference(context).await?;
} }
} }
} }
@ -256,6 +260,8 @@ impl InCommunity for Page {
.await? .await?
} }
}; };
// TODO: doesnt make sense to do this here as were checking audience against itself
if let Some(audience) = &self.audience { if let Some(audience) = &self.audience {
verify_community_matches(audience, community.actor_id.clone())?; verify_community_matches(audience, community.actor_id.clone())?;
} }