DEV: Add DiscourseEvent to PostMover for post_duplicated

This commit is contained in:
Mark VanLandingham 2024-12-13 09:04:59 -06:00
parent f6a4de4805
commit fbfb349655
No known key found for this signature in database
GPG Key ID: 3522A75A293C836D
1 changed files with 5 additions and 1 deletions

View File

@ -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)