FIX: properly filter whispers in user stream

This commit is contained in:
Régis Hanol
2015-09-22 00:50:52 +02:00
parent 2ae032c9b0
commit 4f7140fb32
7 changed files with 18 additions and 17 deletions
+1 -1
View File
@@ -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
View File
@@ -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)