mirror of
https://github.com/discourse/discourse.git
synced 2025-03-08 20:49:50 +00:00
Digest should exclude muted topics.
This commit is contained in:
parent
89aa2380c6
commit
564b1d86b0
@ -266,10 +266,12 @@ class Topic < ActiveRecord::Base
|
|||||||
topics = Topic
|
topics = Topic
|
||||||
.visible
|
.visible
|
||||||
.secured(Guardian.new(user))
|
.secured(Guardian.new(user))
|
||||||
|
.joins("LEFT OUTER JOIN top_topics ON top_topics.topic_id = topics.id")
|
||||||
|
.joins("LEFT OUTER JOIN topic_users ON topic_users.topic_id = topics.id AND topic_users.user_id = #{user.id.to_i}")
|
||||||
.where(closed: false, archived: false)
|
.where(closed: false, archived: false)
|
||||||
|
.where("COALESCE(topic_users.notification_level, 1) <> ?", TopicUser.notification_levels[:muted])
|
||||||
.created_since(since)
|
.created_since(since)
|
||||||
.listable_topics
|
.listable_topics
|
||||||
.joins("LEFT OUTER JOIN top_topics ON top_topics.topic_id = topics.id")
|
|
||||||
.order(TopicQuerySQL.order_top_for(score))
|
.order(TopicQuerySQL.order_top_for(score))
|
||||||
.limit(100)
|
.limit(100)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user