mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 17:02:45 +08:00
bookmarks should only show up in a users stream
This commit is contained in:
parent
0244834a97
commit
6c73b3a971
|
@ -95,6 +95,10 @@ JOIN users pu on pu.id = COALESCE(p.user_id, t.user_id)
|
|||
builder.where("p.deleted_at is null and p2.deleted_at is null")
|
||||
end
|
||||
|
||||
unless guardian.user && guardian.user.id == user_id
|
||||
builder.where("a.action_type not in (#{BOOKMARK})")
|
||||
end
|
||||
|
||||
if !guardian.can_see_private_messages?(user_id) || ignore_private_messages
|
||||
builder.where("a.action_type not in (#{NEW_PRIVATE_MESSAGE},#{GOT_PRIVATE_MESSAGE})")
|
||||
end
|
||||
|
|
|
@ -28,6 +28,8 @@ describe UserAction do
|
|||
row[:action_type] = UserAction::NEW_TOPIC
|
||||
UserAction.log_action!(row)
|
||||
|
||||
row[:action_type] = UserAction::BOOKMARK
|
||||
UserAction.log_action!(row)
|
||||
end
|
||||
|
||||
describe 'stats' do
|
||||
|
@ -63,8 +65,8 @@ describe UserAction do
|
|||
UserAction.stream(user_id: @user.id, guardian: Guardian.new).count.should == 1
|
||||
end
|
||||
|
||||
it 'should have 3 items for non owners' do
|
||||
UserAction.stream(user_id: @user.id, guardian: @user.guardian).count.should == 3
|
||||
it 'should have bookmarks and pms for owners' do
|
||||
UserAction.stream(user_id: @user.id, guardian: @user.guardian).count.should == 4
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user