aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/action.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/models/action.go b/models/action.go
index 595be92f76..43ed9cc1da 100644
--- a/models/action.go
+++ b/models/action.go
@@ -733,12 +733,13 @@ func GetFeeds(opts GetFeedsOptions) ([]*Action, error) {
cond = cond.And(builder.In("repo_id", repoIDs))
}
+ var userIDCond builder.Cond = builder.Eq{"user_id": opts.RequestedUser.ID}
if opts.Collaborate {
- cond = builder.Eq{"user_id": opts.RequestedUser.ID}.Or(
- builder.Expr(`repo_id IN (SELECT repo_id FROM "access" WHERE access.user_id = ?)`, opts.RequestedUser.ID))
- } else {
- cond = builder.Eq{"user_id": opts.RequestedUser.ID}
+ userIDCond = userIDCond.Or(builder.Expr(
+ `repo_id IN (SELECT repo_id FROM "access" WHERE access.user_id = ?)`,
+ opts.RequestedUser.ID))
}
+ cond = cond.And(userIDCond)
if opts.OnlyPerformedBy {
cond = cond.And(builder.Eq{"act_user_id": opts.RequestedUser.ID})