mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 00:31:23 +08:00
FEATURE: Add user to topic_tags_changed event (#28714)
* FEATURE: Add user to topic_tags_changed event Add user to topic_tags_changed event context Update automation plugin with new arguments in event Update tests for new arguments relates to https://github.com/discourse/discourse-chat-integration/pull/214 * DEV: change variable name for better readability changed `tags` to be payload and used `values_at` to get the values of the keys
This commit is contained in:
@ -182,11 +182,14 @@ after_initialize do
|
||||
DiscourseAutomation::EventHandlers.handle_pm_created(topic) if topic.private_message?
|
||||
end
|
||||
|
||||
on(:topic_tags_changed) do |topic, tags|
|
||||
on(:topic_tags_changed) do |topic, payload|
|
||||
old_tag_names, new_tag_names, user = payload.values_at(:old_tag_names, :new_tag_names, :user)
|
||||
|
||||
DiscourseAutomation::EventHandlers.handle_topic_tags_changed(
|
||||
topic,
|
||||
tags[:old_tag_names],
|
||||
tags[:new_tag_names],
|
||||
old_tag_names,
|
||||
new_tag_names,
|
||||
user,
|
||||
)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user