From fbfb34965511bfae353db41dfd7a6d1641165e4d Mon Sep 17 00:00:00 2001 From: Mark VanLandingham Date: Fri, 13 Dec 2024 09:04:59 -0600 Subject: [PATCH] DEV: Add DiscourseEvent to PostMover for post_duplicated --- app/models/post_mover.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/post_mover.rb b/app/models/post_mover.rb index 461be590174..6a34fe47e94 100644 --- a/app/models/post_mover.rb +++ b/app/models/post_mover.rb @@ -323,7 +323,11 @@ class PostMover @post_ids_after_move.map { |post_id| post_id == post.id ? moved_post.id : post_id } end - DiscourseEvent.trigger(:post_moved, moved_post, original_topic.id) + if @options[:freeze_original] + DiscourseEvent.trigger(:post_duplicated, moved_post, post) + else + DiscourseEvent.trigger(:post_moved, moved_post, original_topic.id) + end # Move any links from the post to the new topic moved_post.topic_links.update_all(topic_id: destination_topic.id)