1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-16 07:04:25 +00:00

make private users who follow you visible

This commit is contained in:
6543 2023-11-13 18:37:30 +01:00
parent 3039ef90f2
commit c1517bdfa4
No known key found for this signature in database
GPG Key ID: B8BE6D610E61C862

View File

@ -157,6 +157,10 @@ func BuildCanSeeUserCondition(actor *User) builder.Cond {
if !actor.IsRestricted {
// Not-Restricted users can see public and limited users/organizations
cond = cond.Or(builder.In("`user`.visibility", structs.VisibleTypePublic, structs.VisibleTypeLimited))
// or private users who do follow them
cond = cond.Or(builder.Eq{
"`user`.visibility": structs.VisibleTypePrivate,
"`user`.id": builder.Select("follow.user_id").From("follow").Where(builder.Eq{"follow.follow_id": actor.ID})})
}
// Don't forget about self
return cond.Or(builder.Eq{"`user`.id": actor.ID})