- query = match listing_type {
- ListingType::Subscribed => query.filter(community_follower::person_id.is_not_null()),
- ListingType::Local => query.filter(community::local.eq(true)),
- _ => query,
- };
- }
-
- if let Some(community_id) = self.community_id {
- query = query
- .filter(post::community_id.eq(community_id))
- .then_order_by(post_aggregates::stickied.desc());
+ match listing_type {
+ ListingType::Subscribed => {
+ query = query.filter(community_follower::person_id.is_not_null())
+ }
+ ListingType::Local => {
+ query = query.filter(community::local.eq(true)).filter(
+ community::hidden
+ .eq(false)
+ .or(community_follower::person_id.eq(person_id_join)),
+ );
+ }
+ ListingType::All => {
+ query = query.filter(
+ community::hidden
+ .eq(false)
+ .or(community_follower::person_id.eq(person_id_join)),
+ )
+ }
+ ListingType::Community => {
+ if let Some(community_id) = self.community_id {
+ query = query
+ .filter(post::community_id.eq(community_id))
+ .then_order_by(post_aggregates::stickied.desc());
+ }
+ }
+ }