FIX: 'default_categories_muted' site setting not working for anonymous users.

This commit is contained in:
Vinoth Kannan 2019-11-19 07:48:16 +05:30
parent f49ef851df
commit 57bbcf4c5d

View File

@ -895,6 +895,11 @@ class TopicQuery
regular: CategoryUser.notification_levels[:regular],
tracking: TopicUser.notification_levels[:tracking],
category_id: category_id || -1)
else
category_ids = SiteSetting.default_categories_muted.split("|").map(&:to_i)
category_ids -= [category_id] if category_id.present? && category_ids.include?(category_id)
list = list.where("topics.category_id NOT IN (?)", category_ids) if category_ids.present?
end
list