mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 12:28:59 +08:00
BUGFIX: filter by topic
This commit is contained in:
parent
c7c1c937af
commit
76a250300a
|
@ -64,7 +64,7 @@ class PostAlertObserver < ActiveRecord::Observer
|
||||||
next if user.blank?
|
next if user.blank?
|
||||||
|
|
||||||
destroy_notifications(user, Notification.types[:private_message], post.topic)
|
destroy_notifications(user, Notification.types[:private_message], post.topic)
|
||||||
unread_post = first_unread_post(user,post.topic)
|
unread_post = first_unread_post(user,post.topic) || post
|
||||||
create_notification(user, Notification.types[:private_message], unread_post)
|
create_notification(user, Notification.types[:private_message], unread_post)
|
||||||
end
|
end
|
||||||
elsif post.post_type != Post.types[:moderator_action]
|
elsif post.post_type != Post.types[:moderator_action]
|
||||||
|
@ -84,6 +84,7 @@ class PostAlertObserver < ActiveRecord::Observer
|
||||||
SELECT last_read_post_number FROM topic_users tu
|
SELECT last_read_post_number FROM topic_users tu
|
||||||
WHERE tu.user_id = ? AND tu.topic_id = ? ),0)',
|
WHERE tu.user_id = ? AND tu.topic_id = ? ),0)',
|
||||||
user.id, topic.id)
|
user.id, topic.id)
|
||||||
|
.where(topic_id: topic.id)
|
||||||
.order('post_number').first
|
.order('post_number').first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user