actor_id: Some(self.id.into()),
local: Some(false),
private_key: None,
- hidden: Some(false),
+ hidden: None,
public_key: self.public_key.public_key_pem,
last_refreshed_at: Some(naive_now()),
icon: self.icon.map(|i| i.url.into()),
actor_id: Some(self.id.into()),
local: None,
private_key: None,
- hidden: Some(false),
+ hidden: None,
public_key: Some(self.public_key.public_key_pem),
last_refreshed_at: Some(naive_now()),
icon: Some(self.icon.map(|i| i.url.into())),
if !self.is_mod_or_admin.unwrap_or(true) {
query = query
.filter(community::removed.eq(false))
- .filter(community::deleted.eq(false));
+ .filter(community::deleted.eq(false))
+ .filter(
+ community::hidden
+ .eq(false)
+ .or(community_follower::person_id.eq(person_id_join)),
+ );
}
match self.sort.unwrap_or(SortType::Hot) {
SortType::New => query = query.order_by(community::published.desc()),
SortType::TopAll => query = query.order_by(community_aggregates::subscribers.desc()),
SortType::TopMonth => query = query.order_by(community_aggregates::users_active_month.desc()),
- SortType::Hot => {
- query = query.order_by(community_aggregates::hot_rank.desc());
- // Don't show hidden communities in Hot (trending)
- query = query.filter(
- community::hidden
- .eq(false)
- .or(community_follower::person_id.eq(person_id_join)),
- );
- }
+ SortType::Hot => query = query.order_by(community_aggregates::hot_rank.desc()),
// Covers all other sorts
_ => query = query.order_by(community_aggregates::users_active_month.desc()),
};