mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-03-06 09:11:13 +01:00
Fix when private user following user, private user will not be counted in his own view (#28037) (#28792)
Backport #28037 by @yp05327
Doer: asdasasdasasdasasdasasdasasdasasdasasdas (private user)
Followed: TestUser (public user)
Before:
(From doer's view)

(From followed user's view, can see doer)

After:
(From doer's view)

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 84282c608c
)
This commit is contained in:
parent
82ec85550e
commit
a21fdc881a
1 changed files with 2 additions and 0 deletions
|
@ -1217,6 +1217,8 @@ func isUserVisibleToViewerCond(viewer *User) builder.Cond {
|
||||||
return builder.Neq{
|
return builder.Neq{
|
||||||
"`user`.visibility": structs.VisibleTypePrivate,
|
"`user`.visibility": structs.VisibleTypePrivate,
|
||||||
}.Or(
|
}.Or(
|
||||||
|
// viewer self
|
||||||
|
builder.Eq{"`user`.id": viewer.ID},
|
||||||
// viewer's following
|
// viewer's following
|
||||||
builder.In("`user`.id",
|
builder.In("`user`.id",
|
||||||
builder.
|
builder.
|
||||||
|
|
Loading…
Add table
Reference in a new issue