mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 02:29:31 +08:00
BUGFIX: not updating tracking state after entering a topic
Occurs in 2 cases: 1. Change "Regular" to "Tracking" other browsers do not update 2. If you are set to track all new topics on enter.
This commit is contained in:
parent
f8f0fb15e3
commit
bbca684f6d
|
@ -112,6 +112,13 @@ class TopicUser < ActiveRecord::Base
|
||||||
observe_after_save_callbacks_for topic_id, user_id
|
observe_after_save_callbacks_for topic_id, user_id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if attrs[:notification_level]
|
||||||
|
MessageBus.publish("/topic/#{topic_id}",
|
||||||
|
{notification_level_change: attrs[:notification_level]}, user_ids: [user_id])
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
rescue ActiveRecord::RecordNotUnique
|
rescue ActiveRecord::RecordNotUnique
|
||||||
# In case of a race condition to insert, do nothing
|
# In case of a race condition to insert, do nothing
|
||||||
end
|
end
|
||||||
|
@ -210,6 +217,8 @@ class TopicUser < ActiveRecord::Base
|
||||||
FROM topic_users AS ftu
|
FROM topic_users AS ftu
|
||||||
WHERE ftu.user_id = :user_id and ftu.topic_id = :topic_id)",
|
WHERE ftu.user_id = :user_id and ftu.topic_id = :topic_id)",
|
||||||
args)
|
args)
|
||||||
|
|
||||||
|
MessageBus.publish("/topic/#{topic_id}", {notification_level_change: args[:new_status]}, user_ids: [user.id])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user