diff --git a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php index bbb5278bbf..9842d08b90 100644 --- a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php +++ b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php @@ -4,7 +4,6 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor { private $commit; private $attachInlineComments; - private $noEmail; public function __construct(PhabricatorRepositoryCommit $commit) { $this->commit = $commit; @@ -16,11 +15,6 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor { return $this; } - public function setNoEmail($no_email) { - $this->noEmail = $no_email; - return $this; - } - public function addComments(array $comments) { assert_instances_of($comments, 'PhabricatorAuditComment'); @@ -62,7 +56,6 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor { ->setContinueOnMissingFields(true) ->setContentSource($content_source) ->setExcludeMailRecipientPHIDs($this->getExcludeMailRecipientPHIDs()) - ->setDisableEmail($this->noEmail) ->applyTransactions($commit, $xactions); } diff --git a/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php index 9ed0ebe235..e0e3927f93 100644 --- a/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php +++ b/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php @@ -59,7 +59,7 @@ final class DiffusionCreateCommentConduitAPIMethod $action = PhabricatorAuditActionConstants::COMMENT; } - // Disallow ADD_CCS, ADD_AUDITORS for now + // Disallow ADD_CCS, ADD_AUDITORS forever. if (!in_array($action, array( PhabricatorAuditActionConstants::CONCERN, PhabricatorAuditActionConstants::ACCEPT, @@ -70,27 +70,31 @@ final class DiffusionCreateCommentConduitAPIMethod throw new ConduitException('ERR_BAD_ACTION'); } - $comments = array(); + $xactions = array(); if ($action != PhabricatorAuditActionConstants::COMMENT) { - $comments[] = id(new PhabricatorAuditComment()) - ->setAction($action); + $xactions[] = id(new PhabricatorAuditTransaction()) + ->setTransactionType(PhabricatorAuditActionConstants::ACTION) + ->setNewValue($action); } if (strlen($message)) { - $comments[] = id(new PhabricatorAuditComment()) - ->setAction(PhabricatorAuditActionConstants::COMMENT) - ->setContent($message); + $xactions[] = id(new PhabricatorAuditTransaction()) + ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) + ->attachComment( + id(new PhabricatorAuditTransactionComment()) + ->setCommitPHID($commit->getPHID()) + ->setContent($message)); } - id(new PhabricatorAuditCommentEditor($commit)) + id(new PhabricatorAuditEditor()) ->setActor($request->getUser()) - ->setNoEmail($request->getValue('silent')) - ->addComments($comments); + ->setContentSourceFromConduitRequest($request) + ->setDisableEmail($request->getValue('silent')) + ->setContinueOnMissingFields(true) + ->applyTransactions($commit, $xactions); return true; - // get the full uri of the comment? - // i.e, PhabricatorEnv::getURI(rXX01ab23cd#comment-9) } }