DEV: Pass in old post to post_moved DiscourseEvent (#30274)

This commit is contained in:
Mark VanLandingham
2024-12-13 12:30:00 -06:00
committed by GitHub
parent 316ba67aac
commit 85773eee21
2 changed files with 27 additions and 2 deletions

View File

@@ -286,7 +286,7 @@ class PostMover
end
DiscourseEvent.trigger(:first_post_moved, new_post, post)
DiscourseEvent.trigger(:post_moved, new_post, original_topic.id)
DiscourseEvent.trigger(:post_moved, new_post, original_topic.id, post)
# we don't want to keep the old topic's OP bookmarked when we are
# moving it into a new topic
@@ -323,7 +323,7 @@ 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)
DiscourseEvent.trigger(:post_moved, moved_post, original_topic.id, post)
# Move any links from the post to the new topic
moved_post.topic_links.update_all(topic_id: destination_topic.id)