Skip to content

Commit 7b3701a

Browse files
committed
Fix test
1 parent 00dbb9d commit 7b3701a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

models/activities/action_list.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,21 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, int64, err
213213
// if the actor is the requested user or is an administrator, we can skip the ActivityQueryCondition
214214
if opts.Actor != nil && opts.RequestedUser != nil && (opts.Actor.IsAdmin || opts.Actor.ID == opts.RequestedUser.ID) {
215215
cond = builder.Eq{
216-
"user_id": opts.RequestedUser.ID,
217-
"is_deleted": false,
216+
"user_id": opts.RequestedUser.ID,
218217
}.And(
219218
FeedDateCond(opts),
220219
)
220+
221+
if !opts.IncludeDeleted {
222+
cond = cond.And(builder.Eq{"is_deleted": false})
223+
}
224+
225+
if !opts.IncludePrivate {
226+
cond = cond.And(builder.Eq{"is_private": false})
227+
}
228+
if opts.OnlyPerformedBy {
229+
cond = cond.And(builder.Eq{"act_user_id": opts.RequestedUser.ID})
230+
}
221231
} else {
222232
cond, err = ActivityQueryCondition(ctx, opts)
223233
if err != nil {

0 commit comments

Comments
 (0)