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:
parent
3039ef90f2
commit
c1517bdfa4
@ -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})
|
||||
|
Loading…
Reference in New Issue
Block a user