FEATURE: allow user to override watched_precedence_over_muted setting (#22340)

Recently, site setting watched_precedence_over_muted was introduced - https://github.com/discourse/discourse/pull/22252

In this PR, we are allowing users to override it. The option is only displayed when the user has watched categories and muted tags, or vice versa.
This commit is contained in:
Krzysztof Kotlarek
2023-07-04 15:08:29 +10:00
committed by GitHub
parent 82d6420e31
commit 134dcdd63a
14 changed files with 107 additions and 28 deletions

View File

@ -2160,5 +2160,18 @@ RSpec.describe TopicQuery do
expect(query.topics.map(&:id)).to contain_exactly(topic.id)
end
end
context "when disabled but overridden by user" do
it "returns topics even if category or tag is muted but another tag or category is watched" do
SiteSetting.watched_precedence_over_muted = false
user.user_option.update!(watched_precedence_over_muted: true)
query = TopicQuery.new(user).list_latest
expect(query.topics.map(&:id)).to contain_exactly(
topic.id,
topic_in_watched_category_and_muted_tag.id,
topic_in_muted_category_and_watched_tag.id,
)
end
end
end
end