diff --git a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php index 01b178c1e0..8eb6ce79fc 100644 --- a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php +++ b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php @@ -8,6 +8,8 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor { private $auditors = array(); private $ccs = array(); + private $noEmail; + public function __construct(PhabricatorRepositoryCommit $commit) { $this->commit = $commit; return $this; @@ -28,6 +30,11 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor { return $this; } + public function setNoEmail($no_email) { + $this->noEmail = $no_email; + return $this; + } + public function addComment(PhabricatorAuditComment $comment) { $commit = $this->commit; @@ -297,7 +304,9 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor { id(new PhabricatorSearchIndexer()) ->indexDocumentByPHID($commit->getPHID()); - $this->sendMail($comment, $other_comments, $inline_comments, $requests); + if (!$this->noEmail) { + $this->sendMail($comment, $other_comments, $inline_comments, $requests); + } } diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_createcomment_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_createcomment_Method.php index 692246497f..e4020a0d06 100644 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_createcomment_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_createcomment_Method.php @@ -21,6 +21,7 @@ final class ConduitAPI_diffusion_createcomment_Method 'phid' => 'required string', 'action' => 'optional string', 'message' => 'required string', + 'silent' => 'optional bool', ); } @@ -73,6 +74,7 @@ final class ConduitAPI_diffusion_createcomment_Method id(new PhabricatorAuditCommentEditor($commit)) ->setActor($request->getUser()) + ->setNoEmail($request->getValue('silent')) ->addComment($comment); return true;