fix: don't show posts from banned users ever

This commit is contained in:
trisua 2025-05-16 21:42:14 -04:00
parent 741fe1c986
commit 03480d32db
2 changed files with 22 additions and 0 deletions

View file

@ -635,6 +635,20 @@ pub async fn post_request(
check_user_blocked_or_private!(user, owner, data, jar); check_user_blocked_or_private!(user, owner, data, jar);
if owner.permissions.check_banned() {
if let Some(ref ua) = user {
if !ua.permissions.check(FinePermission::MANAGE_POSTS) {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
} else {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
}
// check repost // check repost
let reposting = data.0.get_post_reposting(&post, &ignore_users, &user).await; let reposting = data.0.get_post_reposting(&post, &ignore_users, &user).await;

View file

@ -198,6 +198,10 @@ impl DataManager {
} else { } else {
let ua = self.get_user_by_id(owner).await?; let ua = self.get_user_by_id(owner).await?;
if ua.permissions.check_banned() {
continue;
}
// check relationship // check relationship
if ua.settings.private_profile { if ua.settings.private_profile {
// if someone were to look for places to optimize memory usage, // if someone were to look for places to optimize memory usage,
@ -304,6 +308,10 @@ impl DataManager {
} else { } else {
let ua = self.get_user_by_id(owner).await?; let ua = self.get_user_by_id(owner).await?;
if ua.permissions.check_banned() {
continue;
}
// check relationship // check relationship
if ua.settings.private_profile && ua.id != user_id { if ua.settings.private_profile && ua.id != user_id {
if user_id == 0 { if user_id == 0 {