summaryrefslogtreecommitdiffstats
path: root/routers/web
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-07-05 16:47:45 +0100
committerGitHub <noreply@github.com>2022-07-05 16:47:45 +0100
commit45f17528a856718457b79011cfd20c127ee87452 (patch)
tree16c1feca3c428274d74c57ff5aa505d6d874ea74 /routers/web
parented13d7aadf75246a3b9ba68c5cd2def867f89f43 (diff)
downloadgitea-45f17528a856718457b79011cfd20c127ee87452.tar.gz
gitea-45f17528a856718457b79011cfd20c127ee87452.zip
Only show Followers that current user can access (#20220)
Users who are following or being followed by a user should only be displayed if the viewing user can see them. Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/web')
-rw-r--r--routers/web/user/profile.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go
index 609f3242c6..6f23d239e2 100644
--- a/routers/web/user/profile.go
+++ b/routers/web/user/profile.go
@@ -157,7 +157,7 @@ func Profile(ctx *context.Context) {
switch tab {
case "followers":
- items, err := user_model.GetUserFollowers(ctx.ContextUser, db.ListOptions{
+ items, count, err := user_model.GetUserFollowers(ctx, ctx.ContextUser, ctx.Doer, db.ListOptions{
PageSize: setting.UI.User.RepoPagingNum,
Page: page,
})
@@ -167,9 +167,9 @@ func Profile(ctx *context.Context) {
}
ctx.Data["Cards"] = items
- total = ctx.ContextUser.NumFollowers
+ total = int(count)
case "following":
- items, err := user_model.GetUserFollowing(ctx.ContextUser, db.ListOptions{
+ items, count, err := user_model.GetUserFollowing(ctx, ctx.ContextUser, ctx.Doer, db.ListOptions{
PageSize: setting.UI.User.RepoPagingNum,
Page: page,
})
@@ -179,7 +179,7 @@ func Profile(ctx *context.Context) {
}
ctx.Data["Cards"] = items
- total = ctx.ContextUser.NumFollowing
+ total = int(count)
case "activity":
ctx.Data["Feeds"], err = models.GetFeeds(ctx, models.GetFeedsOptions{
RequestedUser: ctx.ContextUser,