Skip to content

Commit 1cbe502

Browse files
lunnybkcsoft
authored andcommitted
fix duplicated feed (#2370)
1 parent f916aa0 commit 1cbe502

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

models/action.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,6 @@ type GetFeedsOptions struct {
713713
IncludePrivate bool // include private actions
714714
OnlyPerformedBy bool // only actions performed by requested user
715715
IncludeDeleted bool // include deleted actions
716-
Collaborate bool // Include collaborative repositories
717716
}
718717

719718
// GetFeeds returns actions according to the provided options
@@ -733,13 +732,7 @@ func GetFeeds(opts GetFeedsOptions) ([]*Action, error) {
733732
cond = cond.And(builder.In("repo_id", repoIDs))
734733
}
735734

736-
var userIDCond builder.Cond = builder.Eq{"user_id": opts.RequestedUser.ID}
737-
if opts.Collaborate {
738-
userIDCond = userIDCond.Or(builder.Expr(
739-
"repo_id IN (SELECT repo_id FROM `access` WHERE access.user_id = ?)",
740-
opts.RequestedUser.ID))
741-
}
742-
cond = cond.And(userIDCond)
735+
cond = cond.And(builder.Eq{"user_id": opts.RequestedUser.ID})
743736

744737
if opts.OnlyPerformedBy {
745738
cond = cond.And(builder.Eq{"act_user_id": opts.RequestedUser.ID})

routers/user/home.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ func Dashboard(ctx *context.Context) {
156156
retrieveFeeds(ctx, models.GetFeedsOptions{RequestedUser: ctxUser,
157157
IncludePrivate: true,
158158
OnlyPerformedBy: false,
159-
Collaborate: true,
160159
IncludeDeleted: false,
161160
})
162161
if ctx.Written() {

routers/user/profile.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ func Profile(ctx *context.Context) {
141141
retrieveFeeds(ctx, models.GetFeedsOptions{RequestedUser: ctxUser,
142142
IncludePrivate: showPrivate,
143143
OnlyPerformedBy: true,
144-
Collaborate: true,
145144
IncludeDeleted: false,
146145
})
147146
if ctx.Written() {

0 commit comments

Comments
 (0)