mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 07:55:43 +08:00
BUGFIX: remove hidden posts from a users stream
This commit is contained in:
parent
7ad00f426c
commit
e2d2a955dc
@ -265,6 +265,10 @@ SQL
|
|||||||
|
|
||||||
unless guardian.can_see_deleted_posts?
|
unless guardian.can_see_deleted_posts?
|
||||||
builder.where("p.deleted_at is null and p2.deleted_at is null and t.deleted_at is null")
|
builder.where("p.deleted_at is null and p2.deleted_at is null and t.deleted_at is null")
|
||||||
|
|
||||||
|
current_user_id = -2
|
||||||
|
current_user_id = guardian.user.id if guardian.user
|
||||||
|
builder.where("NOT COALESCE(p.hidden, false) OR p.user_id = :current_user_id", current_user_id: current_user_id )
|
||||||
end
|
end
|
||||||
|
|
||||||
unless (guardian.user && guardian.user.id == user_id) || guardian.is_staff?
|
unless (guardian.user && guardian.user.id == user_id) || guardian.is_staff?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user