add: hide_social_follows setting
This commit is contained in:
parent
e78c43ab62
commit
a337e0c7c1
11 changed files with 179 additions and 96 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue