@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 defunct "metamta.herald.show-hints" Config option

Summary:
Ref T13216. See PHI985. This config option once controlled adding a Herald transcript link to email. However, this was never implemented in a generic way and was removed from revisions in D8459 and from commits in D10705. No one has noticed or asked for this option for several years, so this is probably a good opportunity to simplify the software and reduce the total amount of configuration.

If we did want to pursue this in the future, I'd generally prefer to make it part of the mail detail page (`/mail/detail/12345/`) anyway.

Test Plan: Grepped for `metamta.herald.show-hints` and `addHeraldSection()`, got no hits for either.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13216

Differential Revision: https://secure.phabricator.com/D19833

+2 -57
-16
src/applications/config/option/PhabricatorMetaMTAConfigOptions.php
··· 84 84 EODOC 85 85 )); 86 86 87 - $herald_hints_description = $this->deformat(pht(<<<EODOC 88 - You can disable the Herald hints in email if users prefer smaller messages. 89 - These are the links under the header "WHY DID I GET THIS EMAIL?". If you set 90 - this to `false`, they will not appear in any mail. Users can still navigate to 91 - the links via the web interface. 92 - EODOC 93 - )); 94 - 95 87 $reply_hints_description = $this->deformat(pht(<<<EODOC 96 88 You can disable the hints under "REPLY HANDLER ACTIONS" if users prefer 97 89 smaller messages. The actions themselves will still work properly. ··· 256 248 ->setLocked(true) 257 249 ->setDescription(pht('Domain used for reply email addresses.')) 258 250 ->addExample('phabricator.example.com', ''), 259 - $this->newOption('metamta.herald.show-hints', 'bool', true) 260 - ->setBoolOptions( 261 - array( 262 - pht('Show Herald Hints'), 263 - pht('No Herald Hints'), 264 - )) 265 - ->setSummary(pht('Show hints about Herald rules in email.')) 266 - ->setDescription($herald_hints_description), 267 251 $this->newOption('metamta.recipients.show-hints', 'bool', true) 268 252 ->setBoolOptions( 269 253 array(
-18
src/applications/metamta/view/PhabricatorMetaMTAMailBody.php
··· 151 151 return $this; 152 152 } 153 153 154 - /** 155 - * Add a Herald section with a rule management URI and a transcript URI. 156 - * 157 - * @param string URI to rule transcripts. 158 - * @return this 159 - * @task compose 160 - */ 161 - public function addHeraldSection($xscript_uri) { 162 - if (!PhabricatorEnv::getEnvConfig('metamta.herald.show-hints')) { 163 - return $this; 164 - } 165 - 166 - $this->addLinkSection( 167 - pht('WHY DID I GET THIS EMAIL?'), 168 - PhabricatorEnv::getProductionURI($xscript_uri)); 169 - 170 - return $this; 171 - } 172 154 173 155 /** 174 156 * Add an attachment.
+2 -23
src/applications/metamta/view/__tests__/PhabricatorMetaMTAMailBodyTestCase.php
··· 10 10 bass 11 11 trout 12 12 13 - WHY DID I GET THIS EMAIL? 14 - http://test.com/xscript/ 15 - 16 13 EOTEXT; 17 14 18 - $this->assertEmail($expect, true); 15 + $this->assertEmail($expect); 19 16 } 20 17 21 - public function testBodyRenderNoHerald() { 22 - $expect = <<<EOTEXT 23 - salmon 24 - 25 - HEADER 26 - bass 27 - trout 28 - 29 - EOTEXT; 30 - 31 - $this->assertEmail($expect, false); 32 - } 33 - 34 - private function assertEmail($expect, $herald_hints) { 35 - $env = PhabricatorEnv::beginScopedEnv(); 36 - $env->overrideEnvConfig('phabricator.production-uri', 'http://test.com/'); 37 - $env->overrideEnvConfig('metamta.herald.show-hints', $herald_hints); 38 - 18 + private function assertEmail($expect) { 39 19 $body = new PhabricatorMetaMTAMailBody(); 40 20 $body->addRawSection('salmon'); 41 21 $body->addTextSection('HEADER', "bass\ntrout\n"); 42 - $body->addHeraldSection('/xscript/'); 43 22 44 23 $this->assertEqual($expect, $body->render()); 45 24 }