id = $data['id']; } public function processRequest() { $request = $this->getRequest(); $author_phid = $request->getUser()->getPHID(); $handles = id(new PhabricatorObjectHandleData(array($author_phid))) ->loadHandles(); $engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine(); $comment = new DifferentialComment(); $comment->setContent($request->getStr('content')); $comment->setAction($request->getStr('action')); $comment->setAuthorPHID($author_phid); $view = new DifferentialRevisionCommentView(); $view->setUser($request->getUser()); $view->setComment($comment); $view->setHandles($handles); $view->setMarkupEngine($engine); $view->setPreview(true); $view->setTargetDiff(null); $draft = new PhabricatorDraft(); $draft ->setAuthorPHID($author_phid) ->setDraftKey('differential-comment-'.$this->id) ->setDraft($comment->getContent()) ->replace(); return id(new AphrontAjaxResponse()) ->setContent($view->render()); } }