};
use lemmy_db_schema::{
newtypes::{CommunityId, PersonId},
- source::site::Site,
+ source::local_site::LocalSite,
ModlogActionType,
};
use lemmy_db_views_moderator::structs::{
let local_user_view =
get_local_user_view_from_jwt_opt(data.auth.as_ref(), context.pool(), context.secret())
.await?;
+ let local_site = blocking(context.pool(), LocalSite::read).await??;
- check_private_instance(&local_user_view, context.pool()).await?;
+ check_private_instance(&local_user_view, &local_site)?;
let type_ = data.type_.unwrap_or(All);
let community_id = data.community_id;
- let site = blocking(context.pool(), Site::read_local_site).await??;
let (local_person_id, is_admin) = match local_user_view {
Some(s) => (s.person.id, is_admin(&s).is_ok()),
None => (PersonId(-1), false),
&& is_mod_or_admin(context.pool(), local_person_id, community_id_value)
.await
.is_ok();
- let hide_modlog_names = site.hide_modlog_mod_names && !is_mod_of_community && !is_admin;
+ let hide_modlog_names = local_site.hide_modlog_mod_names && !is_mod_of_community && !is_admin;
let mod_person_id = if hide_modlog_names {
None