/**
  * Copies and inserts the marked posts in a new thread.
  */
 public function copyAndInsert()
 {
     if ($this->board == null) {
         throw new IllegalLinkException();
     }
     $this->board->checkModeratorPermission('canCopyPost');
     // create new thread
     $thread = ThreadEditor::createFromPosts($this->postIDs, $this->board->boardID);
     // move posts
     PostEditor::copyAll($this->postIDs, $thread->threadID, null, $this->board->boardID);
     PostEditor::unmarkAll();
     // check thread
     $thread->checkVisibility();
     // refresh
     $thread->refresh();
     // set last post
     $this->board->refresh();
     $this->board->setLastPosts();
     self::resetCache();
     HeaderUtil::redirect($this->url);
     exit;
 }