Skip to content

Commit c1517bd

Browse files
committed
make private users who follow you visible
1 parent 3039ef9 commit c1517bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/user/search.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ func BuildCanSeeUserCondition(actor *User) builder.Cond {
157157
if !actor.IsRestricted {
158158
// Not-Restricted users can see public and limited users/organizations
159159
cond = cond.Or(builder.In("`user`.visibility", structs.VisibleTypePublic, structs.VisibleTypeLimited))
160+
// or private users who do follow them
161+
cond = cond.Or(builder.Eq{
162+
"`user`.visibility": structs.VisibleTypePrivate,
163+
"`user`.id": builder.Select("follow.user_id").From("follow").Where(builder.Eq{"follow.follow_id": actor.ID})})
160164
}
161165
// Don't forget about self
162166
return cond.Or(builder.Eq{"`user`.id": actor.ID})

0 commit comments

Comments
 (0)