diff --git a/src/applications/conduit/method/differential/ConduitAPI_differential_createcomment_Method.php b/src/applications/conduit/method/differential/ConduitAPI_differential_createcomment_Method.php index b986e9834a..0eacd2efc2 100644 --- a/src/applications/conduit/method/differential/ConduitAPI_differential_createcomment_Method.php +++ b/src/applications/conduit/method/differential/ConduitAPI_differential_createcomment_Method.php @@ -31,6 +31,7 @@ final class ConduitAPI_differential_createcomment_Method 'revision_id' => 'required revisionid', 'message' => 'optional string', 'action' => 'optional string', + 'silent' => 'optional bool', ); } @@ -66,6 +67,7 @@ final class ConduitAPI_differential_createcomment_Method $action); $editor->setContentSource($content_source); $editor->setMessage($request->getValue('message')); + $editor->setNoEmail($request->getValue('silent')); $editor->save(); return array( diff --git a/src/applications/differential/editor/DifferentialCommentEditor.php b/src/applications/differential/editor/DifferentialCommentEditor.php index 9cfd4de8bf..0afd9c5a05 100644 --- a/src/applications/differential/editor/DifferentialCommentEditor.php +++ b/src/applications/differential/editor/DifferentialCommentEditor.php @@ -31,6 +31,7 @@ final class DifferentialCommentEditor { private $parentMessageID; private $contentSource; + private $noEmail; private $isDaemonWorkflow; @@ -105,6 +106,11 @@ final class DifferentialCommentEditor { return $this; } + public function setNoEmail($no_email) { + $this->noEmail = $no_email; + return $this; + } + public function save() { $revision = $this->revision; $action = $this->action; @@ -553,21 +559,23 @@ final class DifferentialCommentEditor { $xherald_header = HeraldTranscript::loadXHeraldRulesHeader( $revision->getPHID()); - id(new DifferentialCommentMail( - $revision, - $actor_handle, - $comment, - $changesets, - $inline_comments)) - ->setToPHIDs( - array_merge( - $revision->getReviewers(), - array($revision->getAuthorPHID()))) - ->setCCPHIDs($revision->getCCPHIDs()) - ->setChangedByCommit($this->getChangedByCommit()) - ->setXHeraldRulesHeader($xherald_header) - ->setParentMessageID($this->parentMessageID) - ->send(); + if (!$this->noEmail) { + id(new DifferentialCommentMail( + $revision, + $actor_handle, + $comment, + $changesets, + $inline_comments)) + ->setToPHIDs( + array_merge( + $revision->getReviewers(), + array($revision->getAuthorPHID()))) + ->setCCPHIDs($revision->getCCPHIDs()) + ->setChangedByCommit($this->getChangedByCommit()) + ->setXHeraldRulesHeader($xherald_header) + ->setParentMessageID($this->parentMessageID) + ->send(); + } $event_data = array( 'revision_id' => $revision->getID(),