mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 15:05:25 -05:00
FIX: properly filter whispers in user stream
This commit is contained in:
@@ -305,7 +305,6 @@ SQL
|
||||
end
|
||||
|
||||
def self.apply_common_filters(builder,user_id,guardian,ignore_private_messages=false)
|
||||
|
||||
# We never return deleted topics in activity
|
||||
builder.where("t.deleted_at is null")
|
||||
|
||||
@@ -318,6 +317,9 @@ SQL
|
||||
builder.where("NOT COALESCE(p.hidden, false) OR p.user_id = :current_user_id", current_user_id: current_user_id )
|
||||
end
|
||||
|
||||
visible_post_types = Topic.visible_post_types(guardian.user)
|
||||
builder.where("COALESCE(p.post_type, p2.post_type) IN (:visible_post_types)", visible_post_types: visible_post_types)
|
||||
|
||||
unless (guardian.user && guardian.user.id == user_id) || guardian.is_staff?
|
||||
builder.where("a.action_type not in (#{BOOKMARK})")
|
||||
builder.where("t.visible")
|
||||
|
||||
Reference in New Issue
Block a user