@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+8 -27
+3 -1
src/applications/differential/conduit/DifferentialCreateCommentConduitAPIMethod.php
··· 106 106 } 107 107 } 108 108 109 + // NOTE: The legacy "silent" flag is now ignored and has no effect. See 110 + // T13042. 111 + 109 112 $editor = id(new DifferentialTransactionEditor()) 110 113 ->setActor($viewer) 111 - ->setDisableEmail($request->getValue('silent')) 112 114 ->setContentSource($request->newContentSource()) 113 115 ->setContinueOnNoEffect(true) 114 116 ->setContinueOnMissingFields(true);
+5 -26
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 59 59 private $isHeraldEditor; 60 60 private $isInverseEdgeEditor; 61 61 private $actingAsPHID; 62 - private $disableEmail; 63 62 64 63 private $heraldEmailPHIDs = array(); 65 64 private $heraldForcedEmailPHIDs = array(); ··· 204 203 205 204 public function getIsHeraldEditor() { 206 205 return $this->isHeraldEditor; 207 - } 208 - 209 - /** 210 - * Prevent this editor from generating email when applying transactions. 211 - * 212 - * @param bool True to disable email. 213 - * @return this 214 - */ 215 - public function setDisableEmail($disable_email) { 216 - $this->disableEmail = $disable_email; 217 - return $this; 218 - } 219 - 220 - public function getDisableEmail() { 221 - return $this->disableEmail; 222 206 } 223 207 224 208 public function setUnmentionablePHIDMap(array $map) { ··· 1152 1136 // Editors need to pass into workers. 1153 1137 $object = $this->willPublish($object, $xactions); 1154 1138 1155 - if (!$this->getDisableEmail()) { 1156 - if ($this->shouldSendMail($object, $xactions)) { 1157 - $this->mailToPHIDs = $this->getMailTo($object); 1158 - $this->mailCCPHIDs = $this->getMailCC($object); 1159 - } 1139 + if ($this->shouldSendMail($object, $xactions)) { 1140 + $this->mailToPHIDs = $this->getMailTo($object); 1141 + $this->mailCCPHIDs = $this->getMailCC($object); 1160 1142 } 1161 1143 1162 1144 if ($this->shouldPublishFeedStory($object, $xactions)) { ··· 1204 1186 $this->object = $object; 1205 1187 1206 1188 $messages = array(); 1207 - if (!$this->getDisableEmail()) { 1208 - if ($this->shouldSendMail($object, $xactions)) { 1209 - $messages = $this->buildMail($object, $xactions); 1210 - } 1189 + if ($this->shouldSendMail($object, $xactions)) { 1190 + $messages = $this->buildMail($object, $xactions); 1211 1191 } 1212 1192 1213 1193 if ($this->supportsSearch()) { ··· 3504 3484 private function getAutomaticStateProperties() { 3505 3485 return array( 3506 3486 'parentMessageID', 3507 - 'disableEmail', 3508 3487 'isNewObject', 3509 3488 'heraldEmailPHIDs', 3510 3489 'heraldForcedEmailPHIDs',