let person_id = local_user_view.to_owned().map(|l| l.person.id);
- // Don't show NSFW by default
- let show_nsfw = match &local_user_view {
- Some(uv) => uv.local_user.show_nsfw,
- None => false,
- };
-
let sort = data.sort;
let listing_type = data.type_;
let page = data.page;
let limit = data.limit;
+ let local_user = local_user_view.map(|l| l.local_user);
let mut communities = blocking(context.pool(), move |conn| {
CommunityQuery::builder()
.conn(conn)
.listing_type(listing_type)
.sort(sort)
- .show_nsfw(Some(show_nsfw))
- .my_person_id(person_id)
+ .local_user(local_user.as_ref())
.page(page)
.limit(limit)
.build()