Skip to content

Commit b820019

Browse files
authored
Fix when private user following user, private user will not be counted in his own view (#28037)
Doer: asdasasdasasdasasdasasdasasdasasdasasdas (private user) Followed: TestUser (public user) Before: (From doer's view) ![image](https://github.com/go-gitea/gitea/assets/18380374/9ba16b3b-068c-43c5-a3dd-e3343b5b32f2) (From followed user's view, can see doer) ![image](https://github.com/go-gitea/gitea/assets/18380374/dfd1b564-d689-4393-b3d3-1e6bf52c94ba) After: (From doer's view) ![image](https://github.com/go-gitea/gitea/assets/18380374/1c85c1d1-c9f7-40c8-948c-145f7cae9a04)
1 parent fee80a1 commit b820019

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

models/user/user.go

+2
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,8 @@ func isUserVisibleToViewerCond(viewer *User) builder.Cond {
12301230
return builder.Neq{
12311231
"`user`.visibility": structs.VisibleTypePrivate,
12321232
}.Or(
1233+
// viewer self
1234+
builder.Eq{"`user`.id": viewer.ID},
12331235
// viewer's following
12341236
builder.In("`user`.id",
12351237
builder.

0 commit comments

Comments
 (0)