mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 12:13:58 -06:00
BUGFIX: not notifying unread and new counts correctly
This commit is contained in:
parent
3767080f3b
commit
41b15d1ad1
@ -134,7 +134,8 @@ Discourse.TopicTrackingState = Discourse.Model.extend({
|
||||
return _.chain(this.states)
|
||||
.where({last_read_post_number: null})
|
||||
.where(function(topic) {
|
||||
return topic.notification_level === null ||
|
||||
// !0 is true
|
||||
return (topic.notification_level !== 0 && !topic.notification_level) ||
|
||||
topic.notification_level >= Discourse.Topic.NotificationLevel.TRACKING;
|
||||
})
|
||||
.where(function(topic){ return topic.category_name === category_name || !category_name;})
|
||||
|
@ -44,7 +44,7 @@ class TopicTrackingState
|
||||
|
||||
TopicUser
|
||||
.tracking(post.topic_id)
|
||||
.select([:user_id,:last_read_post_number])
|
||||
.select([:user_id,:last_read_post_number, :notification_level])
|
||||
.each do |tu|
|
||||
|
||||
message = {
|
||||
@ -54,7 +54,8 @@ class TopicTrackingState
|
||||
last_read_post_number: tu.last_read_post_number,
|
||||
highest_post_number: post.post_number,
|
||||
created_at: post.created_at,
|
||||
topic_id: post.topic_id
|
||||
topic_id: post.topic_id,
|
||||
notification_level: tu.notification_level
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user