mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
FIX: properly filter whispers in user stream
This commit is contained in:
@@ -147,7 +147,7 @@ module PostGuardian
|
||||
return false if post.blank?
|
||||
return true if is_admin?
|
||||
return false unless can_see_topic?(post.topic)
|
||||
return false unless post.user == @user || post.topic.visible_post_types(@user).include?(post.post_type)
|
||||
return false unless post.user == @user || Topic.visible_post_types(@user).include?(post.post_type)
|
||||
return false if !is_moderator? && post.deleted_at.present?
|
||||
|
||||
true
|
||||
|
||||
+1
-1
@@ -331,7 +331,7 @@ class TopicView
|
||||
private
|
||||
|
||||
def filter_post_types(posts)
|
||||
visible_types = @topic.visible_post_types(@user)
|
||||
visible_types = Topic.visible_post_types(@user)
|
||||
|
||||
if @user.present?
|
||||
posts.where("user_id = ? OR post_type IN (?)", @user.id, visible_types)
|
||||
|
||||
Reference in New Issue
Block a user