getRequest(); if (!$request->isFormPost()) { return new Aphront400Response(); } $revision_id = $request->getInt('revision_id'); $revision = id(new DifferentialRevision())->load($revision_id); if (!$revision) { return new Aphront400Response(); } $comment = $request->getStr('comment'); $action = $request->getStr('action'); $reviewers = $request->getArr('reviewers'); $editor = new DifferentialCommentEditor( $revision, $request->getUser()->getPHID(), $action); $editor ->setMessage($comment) ->setAttachInlineComments(true) ->setAddCC($action != DifferentialAction::ACTION_RESIGN) ->setAddedReviewers($reviewers) ->save(); // TODO: Diff change detection? // TODO: Clear draft return id(new AphrontRedirectResponse()) ->setURI('/D'.$revision->getID()); } }