use crate::Perform;
use actix_web::web::Data;
use lemmy_api_common::{
- blocking,
- get_local_user_view_from_jwt,
- is_admin,
person::{BanPerson, BanPersonResponse},
- remove_user_data,
+ utils::{blocking, get_local_user_view_from_jwt, is_admin, remove_user_data},
};
use lemmy_apub::{
activities::block::SiteOrCommunity,
},
traits::Crud,
};
-use lemmy_db_views_actor::person_view::PersonViewSafe;
-use lemmy_utils::{utils::naive_from_unix, ConnectionId, LemmyError};
+use lemmy_db_views_actor::structs::PersonViewSafe;
+use lemmy_utils::{error::LemmyError, utils::naive_from_unix, ConnectionId};
use lemmy_websocket::{messages::SendAllMessage, LemmyContext, UserOperation};
#[async_trait::async_trait(?Send)]
let banned_person_id = data.person_id;
let expires = data.expires.map(naive_from_unix);
- let ban_person = move |conn: &'_ _| Person::ban_person(conn, banned_person_id, ban, expires);
+ let ban_person = move |conn: &mut _| Person::ban_person(conn, banned_person_id, ban, expires);
let person = blocking(context.pool(), ban_person)
.await?
.map_err(|e| LemmyError::from_error_message(e, "couldnt_update_user"))?;
// Remove their data if that's desired
let remove_data = data.remove_data.unwrap_or(false);
if remove_data {
- remove_user_data(person.id, context.pool()).await?;
+ remove_user_data(
+ person.id,
+ context.pool(),
+ context.settings(),
+ context.client(),
+ )
+ .await?;
}
// Mod tables