FIX: topic_tracking_state when mute_all_categories_by_default is enabled

This commit is contained in:
David Taylor
2020-01-06 18:22:42 +00:00
parent ba00d87a16
commit d1779346e8
3 changed files with 25 additions and 6 deletions

View File

@@ -306,9 +306,10 @@ class TopicTrackingState
#{tags_filter}
topics.deleted_at IS NULL AND
#{category_filter}
(category_users.notification_level IS NULL OR
last_read_post_number IS NOT NULL OR
category_users.notification_level <> #{CategoryUser.notification_levels[:muted]})
NOT (
last_read_post_number IS NULL AND
COALESCE(category_users.notification_level, #{CategoryUser.default_notification_level}) = #{CategoryUser.notification_levels[:muted]}
)
SQL
if opts[:topic_id]