},
traits::{Bannable, Crud, Followable},
};
-use lemmy_utils::{error::LemmyError, settings::structs::Settings, utils::convert_datetime};
+use lemmy_utils::{error::LemmyError, utils::convert_datetime};
use lemmy_websocket::LemmyContext;
use url::Url;
{
SiteOrCommunity::Site(site) => {
let domain = self.object.inner().domain().expect("url needs domain");
- if Settings::get().hostname == domain {
+ if context.settings().hostname == domain {
return Err(
anyhow!("Site bans from remote instance can't affect user's home instance").into(),
);
})
.await??;
if self.remove_data.unwrap_or(false) {
- remove_user_data(blocked_person.id, context.pool()).await?;
+ remove_user_data(
+ blocked_person.id,
+ context.pool(),
+ context.settings(),
+ context.client(),
+ )
+ .await?;
}
// write mod log
person_id: blocked_person.id,
pending: false,
};
- blocking(context.pool(), move |conn: &'_ _| {
+ blocking(context.pool(), move |conn: &mut _| {
CommunityFollower::unfollow(conn, &community_follower_form)
})
.await?