@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 reply handler instructions from email

Summary:
Ref T7199. Although this is useful for discovery, it's un-useful enough that we already have an option to disable it, and most applications do not provide any meaningful instructions.

Throwing it away makes it easier to move forward and lets us get rid of a config option.

This is becoming a more advanced/power-user feature anyway, and the new syntax will be significantly more complex and hard to explain with a one-liner. I'm currently thinking that I'll maybe make the "help" menu a dropdown and give it some options like:

+---+
| O |
+---+---------------------+
| Maniphest Documentation |
| Maniphest Email Actions |
+-------------------------+

Then you click the "Email Actions" thing and get a runtime-derived list of available options. Not sure if I'll actually build that, but I think we can fairly throw the in-mail instructions away even if we don't go in that specific direction.

Test Plan: Grepped for `replyHandlerInstructions`, got no hits.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7199

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

+6 -225
-8
src/applications/audit/mail/PhabricatorAuditReplyHandler.php
··· 22 22 'metamta.diffusion.reply-handler-domain'); 23 23 } 24 24 25 - public function getReplyHandlerInstructions() { 26 - if ($this->supportsReplies()) { 27 - return pht('Reply to comment.'); 28 - } else { 29 - return null; 30 - } 31 - } 32 - 33 25 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 34 26 $commit = $this->getMailReceiver(); 35 27 $actor = $this->getActor();
+2
src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
··· 220 220 'security.allow-outbound-http' => pht( 221 221 'This option has been replaced with the more granular option '. 222 222 '`security.outbound-blacklist`.'), 223 + 'metamta.reply.show-hints' => pht( 224 + 'Phabricator no longer shows reply hints in mail.'), 223 225 ); 224 226 225 227 return $ancient_config;
-8
src/applications/config/option/PhabricatorMetaMTAConfigOptions.php
··· 249 249 'Domain used for reply email addresses. Some applications can '. 250 250 'override this configuration with a different domain.')) 251 251 ->addExample('phabricator.example.com', ''), 252 - $this->newOption('metamta.reply.show-hints', 'bool', true) 253 - ->setBoolOptions( 254 - array( 255 - pht('Show Reply Handler Hints'), 256 - pht('No Reply Handler Hints'), 257 - )) 258 - ->setSummary(pht('Show hints about reply handler actions in email.')) 259 - ->setDescription($reply_hints_description), 260 252 $this->newOption('metamta.herald.show-hints', 'bool', true) 261 253 ->setBoolOptions( 262 254 array(
-8
src/applications/conpherence/mail/ConpherenceReplyHandler.php
··· 27 27 return $this->getDefaultPublicReplyHandlerEmailAddress('Z'); 28 28 } 29 29 30 - public function getReplyHandlerInstructions() { 31 - if ($this->supportsReplies()) { 32 - return pht('Reply to comment and attach files.'); 33 - } else { 34 - return null; 35 - } 36 - } 37 - 38 30 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 39 31 $conpherence = $this->getMailReceiver(); 40 32 $user = $this->getActor();
-47
src/applications/differential/mail/DifferentialReplyHandler.php
··· 29 29 'metamta.differential.reply-handler-domain'); 30 30 } 31 31 32 - /* 33 - * Generate text like the following from the supported commands. 34 - * " 35 - * 36 - * ACTIONS 37 - * Reply to comment, or !accept, !reject, !abandon, !resign, !reclaim. 38 - * 39 - * " 40 - */ 41 - public function getReplyHandlerInstructions() { 42 - if (!$this->supportsReplies()) { 43 - return null; 44 - } 45 - 46 - $supported_commands = $this->getSupportedCommands(); 47 - $text = ''; 48 - if (empty($supported_commands)) { 49 - return $text; 50 - } 51 - 52 - $comment_command_printed = false; 53 - if (in_array(DifferentialAction::ACTION_COMMENT, $supported_commands)) { 54 - $text .= pht('Reply to comment'); 55 - $comment_command_printed = true; 56 - 57 - $supported_commands = array_diff( 58 - $supported_commands, array(DifferentialAction::ACTION_COMMENT)); 59 - } 60 - 61 - if (!empty($supported_commands)) { 62 - if ($comment_command_printed) { 63 - $text .= ', or '; 64 - } 65 - 66 - $modified_commands = array(); 67 - foreach ($supported_commands as $command) { 68 - $modified_commands[] = '!'.$command; 69 - } 70 - 71 - $text .= implode(', ', $modified_commands); 72 - } 73 - 74 - $text .= '.'; 75 - 76 - return $text; 77 - } 78 - 79 32 public function getSupportedCommands() { 80 33 $actions = array( 81 34 DifferentialAction::ACTION_COMMENT,
-8
src/applications/files/mail/FileReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('F'); 18 18 } 19 19 20 - public function getReplyHandlerInstructions() { 21 - if ($this->supportsReplies()) { 22 - return pht('Reply to comment or !unsubscribe.'); 23 - } else { 24 - return null; 25 - } 26 - } 27 - 28 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 29 21 $actor = $this->getActor(); 30 22 $file = $this->getMailReceiver();
-9
src/applications/fund/mail/FundInitiativeReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('I'); 18 18 } 19 19 20 - public function getReplyHandlerInstructions() { 21 - if ($this->supportsReplies()) { 22 - // TODO: Implement. 23 - return null; 24 - } else { 25 - return null; 26 - } 27 - } 28 - 29 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 30 21 // TODO: Implement. 31 22 return null;
-8
src/applications/legalpad/mail/LegalpadReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('L'); 18 18 } 19 19 20 - public function getReplyHandlerInstructions() { 21 - if ($this->supportsReplies()) { 22 - return pht('Reply to comment or !unsubscribe.'); 23 - } else { 24 - return null; 25 - } 26 - } 27 - 28 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 29 21 $actor = $this->getActor(); 30 22 $document = $this->getMailReceiver();
-10
src/applications/macro/mail/PhabricatorMacroReplyHandler.php
··· 22 22 'metamta.macro.reply-handler-domain'); 23 23 } 24 24 25 - public function getReplyHandlerInstructions() { 26 - if ($this->supportsReplies()) { 27 - // TODO: Implement. 28 - return null; 29 - return pht('Reply to comment.'); 30 - } else { 31 - return null; 32 - } 33 - } 34 - 35 25 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 36 26 // TODO: Implement this. 37 27 return null;
-10
src/applications/maniphest/mail/ManiphestReplyHandler.php
··· 22 22 'metamta.maniphest.reply-handler-domain'); 23 23 } 24 24 25 - public function getReplyHandlerInstructions() { 26 - if ($this->supportsReplies()) { 27 - return pht( 28 - 'Reply to comment or attach files, or !close, !claim, '. 29 - '!unsubscribe or !assign <username>.'); 30 - } else { 31 - return null; 32 - } 33 - } 34 - 35 25 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 36 26 // NOTE: We'll drop in here on both the "reply to a task" and "create a 37 27 // new task" workflows! Make sure you test both if you make changes!
-1
src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php
··· 63 63 'metamta.reply-handler-domain'); 64 64 } 65 65 66 - abstract public function getReplyHandlerInstructions(); 67 66 abstract protected function receiveEmail( 68 67 PhabricatorMetaMTAReceivedMail $mail); 69 68
+1 -20
src/applications/metamta/view/PhabricatorMetaMTAMailBody.php
··· 160 160 161 161 162 162 /** 163 - * Add a section with reply handler instructions. 164 - * 165 - * @param string Reply handler instructions. 166 - * @return this 167 - * @task compose 168 - */ 169 - public function addReplySection($instructions) { 170 - if (!PhabricatorEnv::getEnvConfig('metamta.reply.show-hints')) { 171 - return $this; 172 - } 173 - if (!strlen($instructions)) { 174 - return $this; 175 - } 176 - 177 - $this->addTextSection(pht('REPLY HANDLER ACTIONS'), $instructions); 178 - 179 - return $this; 180 - } 181 - 182 - /** 183 163 * Add a section with a link to email preferences. 184 164 * 185 165 * @return this ··· 196 176 197 177 return $this; 198 178 } 179 + 199 180 200 181 /** 201 182 * Add an attachment.
+3 -28
src/applications/metamta/view/__tests__/PhabricatorMetaMTAMailBodyTestCase.php
··· 13 13 WHY DID I GET THIS EMAIL? 14 14 http://test.com/xscript/ 15 15 16 - REPLY HANDLER ACTIONS 17 - pike 18 - 19 16 EOTEXT; 20 17 21 - $this->assertEmail($expect, true, true); 18 + $this->assertEmail($expect, true); 22 19 } 23 20 24 21 public function testBodyRenderNoHerald() { ··· 28 25 HEADER 29 26 bass 30 27 trout 31 - 32 - REPLY HANDLER ACTIONS 33 - pike 34 28 35 29 EOTEXT; 36 30 37 - $this->assertEmail($expect, false, true); 31 + $this->assertEmail($expect, false); 38 32 } 39 33 40 - 41 - public function testBodyRenderNoReply() { 42 - $expect = <<<EOTEXT 43 - salmon 44 - 45 - HEADER 46 - bass 47 - trout 48 - 49 - WHY DID I GET THIS EMAIL? 50 - http://test.com/xscript/ 51 - 52 - EOTEXT; 53 - 54 - $this->assertEmail($expect, true, false); 55 - } 56 - 57 - private function assertEmail($expect, $herald_hints, $reply_hints) { 34 + private function assertEmail($expect, $herald_hints) { 58 35 $env = PhabricatorEnv::beginScopedEnv(); 59 36 $env->overrideEnvConfig('phabricator.production-uri', 'http://test.com/'); 60 37 $env->overrideEnvConfig('metamta.herald.show-hints', $herald_hints); 61 - $env->overrideEnvConfig('metamta.reply.show-hints', $reply_hints); 62 38 63 39 $body = new PhabricatorMetaMTAMailBody(); 64 40 $body->addRawSection('salmon'); 65 41 $body->addTextSection('HEADER', "bass\ntrout\n"); 66 42 $body->addHeraldSection('/xscript/'); 67 - $body->addReplySection('pike'); 68 43 69 44 $this->assertEqual($expect, $body->render()); 70 45 }
-4
src/applications/owners/mail/OwnersPackageReplyHandler.php
··· 20 20 return null; 21 21 } 22 22 23 - public function getReplyHandlerInstructions() { 24 - return null; 25 - } 26 - 27 23 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 28 24 return; 29 25 }
-8
src/applications/paste/mail/PasteReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('P'); 18 18 } 19 19 20 - public function getReplyHandlerInstructions() { 21 - if ($this->supportsReplies()) { 22 - return pht('Reply to comment or !unsubscribe.'); 23 - } else { 24 - return null; 25 - } 26 - } 27 - 28 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 29 21 $actor = $this->getActor(); 30 22 $paste = $this->getMailReceiver();
-10
src/applications/pholio/mail/PholioReplyHandler.php
··· 22 22 'metamta.pholio.reply-handler-domain'); 23 23 } 24 24 25 - public function getReplyHandlerInstructions() { 26 - if ($this->supportsReplies()) { 27 - // TODO: Implement. 28 - return null; 29 - return pht('Reply to comment.'); 30 - } else { 31 - return null; 32 - } 33 - } 34 - 35 25 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 36 26 // TODO: Implement this. 37 27 return null;
-9
src/applications/phortune/mail/PhortuneCartReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('CART'); 18 18 } 19 19 20 - public function getReplyHandlerInstructions() { 21 - if ($this->supportsReplies()) { 22 - // TODO: Implement. 23 - return null; 24 - } else { 25 - return null; 26 - } 27 - } 28 - 29 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 30 21 // TODO: Implement. 31 22 return null;
-9
src/applications/phriction/mail/PhrictionReplyHandler.php
··· 20 20 PhrictionDocumentPHIDType::TYPECONST); 21 21 } 22 22 23 - public function getReplyHandlerInstructions() { 24 - if ($this->supportsReplies()) { 25 - // TODO: Implement. 26 - return null; 27 - } else { 28 - return null; 29 - } 30 - } 31 - 32 23 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 33 24 // TODO: Implement. 34 25 return null;
-4
src/applications/ponder/mail/PonderQuestionReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('Q'); 18 18 } 19 19 20 - public function getReplyHandlerInstructions() { 21 - return null; 22 - } 23 - 24 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 25 21 // ignore this entirely for now 26 22 }
-8
src/applications/releeph/mail/ReleephRequestReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('RERQ'); 18 18 } 19 19 20 - public function getReplyHandlerInstructions() { 21 - if ($this->supportsReplies()) { 22 - return pht('Reply to comment.'); 23 - } else { 24 - return null; 25 - } 26 - } 27 - 28 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 29 21 $rq = $this->getMailReceiver(); 30 22 $user = $this->getActor();
-4
src/applications/repository/mail/PhabricatorRepositoryPushReplyHandler.php
··· 16 16 return null; 17 17 } 18 18 19 - public function getReplyHandlerInstructions() { 20 - return null; 21 - } 22 - 23 19 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 24 20 return; 25 21 }
-4
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 1983 1983 $action = $this->getMailAction($object, $xactions); 1984 1984 1985 1985 $reply_handler = $this->buildReplyHandler($object); 1986 - $reply_section = $reply_handler->getReplyHandlerInstructions(); 1987 - if ($reply_section !== null) { 1988 - $body->addReplySection($reply_section); 1989 - } 1990 1986 1991 1987 $body->addEmailPreferenceSection(); 1992 1988