mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 14:51:06 +01:00
Remove legacy transaction editor "getDisableEmail()" method
Summary: Ref T13042. This is a very, very old policy-violating option from yesteryear which supported build systems publishing updates by adding comments to revisions, without sending email about it. Harbormaster has served this role for a long time and this is policy-violating in the general case (it allows attackers to act in secret). Test Plan: Grepped for affected symbols. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13042 Differential Revision: https://secure.phabricator.com/D18881
This commit is contained in:
parent
7a43181337
commit
8a5def8e0a
2 changed files with 8 additions and 27 deletions
|
@ -106,9 +106,11 @@ final class DifferentialCreateCommentConduitAPIMethod
|
|||
}
|
||||
}
|
||||
|
||||
// NOTE: The legacy "silent" flag is now ignored and has no effect. See
|
||||
// T13042.
|
||||
|
||||
$editor = id(new DifferentialTransactionEditor())
|
||||
->setActor($viewer)
|
||||
->setDisableEmail($request->getValue('silent'))
|
||||
->setContentSource($request->newContentSource())
|
||||
->setContinueOnNoEffect(true)
|
||||
->setContinueOnMissingFields(true);
|
||||
|
|
|
@ -59,7 +59,6 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
private $isHeraldEditor;
|
||||
private $isInverseEdgeEditor;
|
||||
private $actingAsPHID;
|
||||
private $disableEmail;
|
||||
|
||||
private $heraldEmailPHIDs = array();
|
||||
private $heraldForcedEmailPHIDs = array();
|
||||
|
@ -206,21 +205,6 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
return $this->isHeraldEditor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent this editor from generating email when applying transactions.
|
||||
*
|
||||
* @param bool True to disable email.
|
||||
* @return this
|
||||
*/
|
||||
public function setDisableEmail($disable_email) {
|
||||
$this->disableEmail = $disable_email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDisableEmail() {
|
||||
return $this->disableEmail;
|
||||
}
|
||||
|
||||
public function setUnmentionablePHIDMap(array $map) {
|
||||
$this->unmentionablePHIDMap = $map;
|
||||
return $this;
|
||||
|
@ -1152,11 +1136,9 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
// Editors need to pass into workers.
|
||||
$object = $this->willPublish($object, $xactions);
|
||||
|
||||
if (!$this->getDisableEmail()) {
|
||||
if ($this->shouldSendMail($object, $xactions)) {
|
||||
$this->mailToPHIDs = $this->getMailTo($object);
|
||||
$this->mailCCPHIDs = $this->getMailCC($object);
|
||||
}
|
||||
if ($this->shouldSendMail($object, $xactions)) {
|
||||
$this->mailToPHIDs = $this->getMailTo($object);
|
||||
$this->mailCCPHIDs = $this->getMailCC($object);
|
||||
}
|
||||
|
||||
if ($this->shouldPublishFeedStory($object, $xactions)) {
|
||||
|
@ -1204,10 +1186,8 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
$this->object = $object;
|
||||
|
||||
$messages = array();
|
||||
if (!$this->getDisableEmail()) {
|
||||
if ($this->shouldSendMail($object, $xactions)) {
|
||||
$messages = $this->buildMail($object, $xactions);
|
||||
}
|
||||
if ($this->shouldSendMail($object, $xactions)) {
|
||||
$messages = $this->buildMail($object, $xactions);
|
||||
}
|
||||
|
||||
if ($this->supportsSearch()) {
|
||||
|
@ -3504,7 +3484,6 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
private function getAutomaticStateProperties() {
|
||||
return array(
|
||||
'parentMessageID',
|
||||
'disableEmail',
|
||||
'isNewObject',
|
||||
'heraldEmailPHIDs',
|
||||
'heraldForcedEmailPHIDs',
|
||||
|
|
Loading…
Reference in a new issue