mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +01:00
Add a 'silent' option to diffusion.createcomment
Test Plan: Created comments with 'silent' both true and empty, received notifcation for only the latter. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley CC: Korvin, epriestley, aran Differential Revision: https://secure.phabricator.com/D7916
This commit is contained in:
parent
982e0d78ae
commit
6639f93153
2 changed files with 12 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue