Browse Source

Merge pull request 'remove banned users from getsite endpoint' (#311) from fix/remove-sitebans-from-site-endpoint into main

Reviewed-on: https://git.chapo.chat/hexbear-collective/lemmy-hexbear/pulls/311
main v0.7.59.hex
DashEightMate 5 months ago
parent
commit
3443fe54f4
  1. 1
      server/lemmy_api_structs/src/site.rs
  2. 6
      server/src/api/site.rs

1
server/lemmy_api_structs/src/site.rs

@ -113,7 +113,6 @@ pub struct GetSiteResponse {
pub my_user: Option<User_>,
pub admins: Vec<UserViewSafe>,
pub sitemods: Vec<UserViewSafe>, // hexbear
pub banned: Vec<UserViewSafe>,
pub federated_instances: Vec<String>,
}

6
server/src/api/site.rs

@ -451,8 +451,6 @@ impl Perform for GetSite {
}
}
let banned = blocking(context.pool(), move |conn| UserViewSafe::banned(conn)).await??;
let online = context
.chat_server()
.send(GetUsersOnline)
@ -473,7 +471,6 @@ impl Perform for GetSite {
site: site_view,
admins,
sitemods,
banned,
online,
version: version::SEMVER_LIGHTWEIGHT.to_string(),
my_user,
@ -696,13 +693,10 @@ impl Perform for TransferSite {
let creator_user = admins.remove(creator_index);
admins.insert(0, creator_user);
let banned = blocking(context.pool(), move |conn| UserViewSafe::banned(conn)).await??;
Ok(GetSiteResponse {
site: Some(site_view),
admins,
sitemods,
banned,
online: 0,
version: version::SEMVER_LIGHTWEIGHT.to_string(),
my_user: Some(user),

Loading…
Cancel
Save