FEATURE: move posts to new/existing PM (#6802)

This commit is contained in:
Arpit Jalan
2018-12-31 17:17:22 +05:30
committed by GitHub
parent b478984f60
commit 70fdc10365
22 changed files with 1357 additions and 691 deletions

View File

@ -896,10 +896,10 @@ class Topic < ActiveRecord::Base
end
def move_posts(moved_by, post_ids, opts)
post_mover = PostMover.new(self, moved_by, post_ids)
post_mover = PostMover.new(self, moved_by, post_ids, move_to_pm: opts[:archetype].present? && opts[:archetype] == "private_message")
if opts[:destination_topic_id]
topic = post_mover.to_topic(opts[:destination_topic_id])
topic = post_mover.to_topic(opts[:destination_topic_id], participants: opts[:participants])
DiscourseEvent.trigger(:topic_merged,
post_mover.original_topic,