mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 01:21:23 +08:00
FEATURE: Added trigger for topic tags changed (#28176)
* FEATURE: Added trigger for topic tags changed * DEV: register new file in plugin.rb * DEV: update to use already existing `:topic_tags_changed` event * DEV: Add tests to topic_tags_changed trigger remove `watching_user` field * DEV: add more tests to topic_tags_changed_spec.rb * DEV: update tests and implementation for topic tags changed automation trigger * DEV: update checking for tags changed automation * DEV: Update argument application for `handle_topic_tags_changed`
This commit is contained in:
@ -72,6 +72,7 @@ after_initialize do
|
||||
lib/discourse_automation/triggers/recurring
|
||||
lib/discourse_automation/triggers/stalled_topic
|
||||
lib/discourse_automation/triggers/stalled_wiki
|
||||
lib/discourse_automation/triggers/topic_tags_changed
|
||||
lib/discourse_automation/triggers/topic
|
||||
lib/discourse_automation/triggers/user_added_to_group
|
||||
lib/discourse_automation/triggers/user_badge_granted
|
||||
@ -181,6 +182,14 @@ after_initialize do
|
||||
DiscourseAutomation::EventHandlers.handle_pm_created(topic) if topic.private_message?
|
||||
end
|
||||
|
||||
on(:topic_tags_changed) do |topic, tags|
|
||||
DiscourseAutomation::EventHandlers.handle_topic_tags_changed(
|
||||
topic,
|
||||
tags[:old_tag_names],
|
||||
tags[:new_tag_names],
|
||||
)
|
||||
end
|
||||
|
||||
on(:post_created) do |post|
|
||||
DiscourseAutomation::EventHandlers.handle_post_created_edited(post, :create)
|
||||
end
|
||||
|
Reference in New Issue
Block a user