mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -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)
|
return _.chain(this.states)
|
||||||
.where({last_read_post_number: null})
|
.where({last_read_post_number: null})
|
||||||
.where(function(topic) {
|
.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;
|
topic.notification_level >= Discourse.Topic.NotificationLevel.TRACKING;
|
||||||
})
|
})
|
||||||
.where(function(topic){ return topic.category_name === category_name || !category_name;})
|
.where(function(topic){ return topic.category_name === category_name || !category_name;})
|
||||||
|
@ -44,7 +44,7 @@ class TopicTrackingState
|
|||||||
|
|
||||||
TopicUser
|
TopicUser
|
||||||
.tracking(post.topic_id)
|
.tracking(post.topic_id)
|
||||||
.select([:user_id,:last_read_post_number])
|
.select([:user_id,:last_read_post_number, :notification_level])
|
||||||
.each do |tu|
|
.each do |tu|
|
||||||
|
|
||||||
message = {
|
message = {
|
||||||
@ -54,7 +54,8 @@ class TopicTrackingState
|
|||||||
last_read_post_number: tu.last_read_post_number,
|
last_read_post_number: tu.last_read_post_number,
|
||||||
highest_post_number: post.post_number,
|
highest_post_number: post.post_number,
|
||||||
created_at: post.created_at,
|
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