mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FIX: Notify tag watchers when publishing topic (#17576)
When a topic was published from a shared draft and it had tags, the users watching the tags were not notified. The problem was that the topics are usually created in a secret category and publishing it just moves an existent topic to the target category, without making any changes to the tags.
This commit is contained in:
@ -46,6 +46,14 @@ class TopicPublisher
|
||||
end
|
||||
end
|
||||
|
||||
Jobs.enqueue(
|
||||
:notify_tag_change,
|
||||
post_id: @topic.first_post.id,
|
||||
notified_user_ids: [@topic.first_post.user_id, @published_by.id].uniq,
|
||||
diff_tags: @topic.tags.map(&:name),
|
||||
force: true,
|
||||
)
|
||||
|
||||
MessageBus.publish("/topic/#{@topic.id}", reload_topic: true, refresh_stream: true)
|
||||
|
||||
@topic
|
||||
|
Reference in New Issue
Block a user