add: hide_social_follows setting

This commit is contained in:
trisua 2025-07-25 13:39:34 -04:00
parent e78c43ab62
commit a337e0c7c1
11 changed files with 179 additions and 96 deletions

View file

@ -731,6 +731,21 @@ pub async fn following_request(
check_user_blocked_or_private!(user, other_user, data, jar);
// check hide_social_follows
if other_user.settings.hide_social_follows {
if let Some(ref ua) = user {
if ua.id != other_user.id {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
} else {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
}
// fetch data
let list = match data
.0
@ -826,6 +841,21 @@ pub async fn followers_request(
check_user_blocked_or_private!(user, other_user, data, jar);
// check hide_social_follows
if other_user.settings.hide_social_follows {
if let Some(ref ua) = user {
if ua.id != other_user.id {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
} else {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
}
// fetch data
let list = match data
.0