@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.

Add support for more granular sending of email in application transactions

Summary: Deploy on paste and macro for create stories, 'cuz those are boring emails. Fixes T3808.

Test Plan: made a paste and a macro. commented on 'em. verified i got mail on comments only.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Maniphest Tasks: T3808

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

+44 -10
+3 -1
src/applications/conpherence/editor/ConpherenceEditor.php
··· 322 322 return parent::mergeTransactions($u, $v); 323 323 } 324 324 325 - protected function supportsMail() { 325 + protected function shouldSendMail( 326 + PhabricatorLiskDAO $object, 327 + array $xactions) { 326 328 return true; 327 329 } 328 330
+3 -1
src/applications/files/editor/PhabricatorFileEditor.php
··· 36 36 PhabricatorApplicationTransaction $xaction) { 37 37 } 38 38 39 - protected function supportsMail() { 39 + protected function shouldSendMail( 40 + PhabricatorLiskDAO $object, 41 + array $xactions) { 40 42 return true; 41 43 } 42 44
+3 -1
src/applications/legalpad/editor/LegalpadDocumentEditor.php
··· 122 122 123 123 /* -( Sending Mail )------------------------------------------------------- */ 124 124 125 - protected function supportsMail() { 125 + protected function shouldSendMail( 126 + PhabricatorLiskDAO $object, 127 + array $xactions) { 126 128 return true; 127 129 } 128 130
+11 -1
src/applications/macro/editor/PhabricatorMacroEditor.php
··· 78 78 return parent::mergeTransactions($u, $v); 79 79 } 80 80 81 - protected function supportsMail() { 81 + protected function shouldSendMail( 82 + PhabricatorLiskDAO $object, 83 + array $xactions) { 84 + foreach ($xactions as $xaction) { 85 + switch ($xaction->getTransactionType()) { 86 + case PhabricatorMacroTransactionType::TYPE_NAME; 87 + return ($xaction->getOldValue() !== null); 88 + default: 89 + break; 90 + } 91 + } 82 92 return true; 83 93 } 84 94
+11 -1
src/applications/paste/editor/PhabricatorPasteEditor.php
··· 100 100 } 101 101 } 102 102 103 - protected function supportsMail() { 103 + protected function shouldSendMail( 104 + PhabricatorLiskDAO $object, 105 + array $xactions) { 106 + foreach ($xactions as $xaction) { 107 + switch ($xaction->getTransactionType()) { 108 + case PhabricatorPasteTransaction::TYPE_CREATE: 109 + return false; 110 + default: 111 + break; 112 + } 113 + } 104 114 return true; 105 115 } 106 116
+3 -1
src/applications/pholio/editor/PholioMockEditor.php
··· 288 288 return parent::mergeTransactions($u, $v); 289 289 } 290 290 291 - protected function supportsMail() { 291 + protected function shouldSendMail( 292 + PhabricatorLiskDAO $object, 293 + array $xactions) { 292 294 return true; 293 295 } 294 296
+3 -1
src/applications/ponder/editor/PonderQuestionEditor.php
··· 165 165 return parent::shouldImplyCC($object, $xaction); 166 166 } 167 167 168 - protected function supportsMail() { 168 + protected function shouldSendMail( 169 + PhabricatorLiskDAO $object, 170 + array $xactions) { 169 171 return true; 170 172 } 171 173
+3 -1
src/applications/releeph/editor/ReleephRequestTransactionalEditor.php
··· 155 155 return parent::filterTransactions($object, $xactions); 156 156 } 157 157 158 - protected function supportsMail() { 158 + protected function shouldSendMail( 159 + PhabricatorLiskDAO $object, 160 + array $xactions) { 159 161 return true; 160 162 } 161 163
+4 -2
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 457 457 $this->loadHandles($xactions); 458 458 459 459 $mail = null; 460 - if ($this->supportsMail()) { 460 + if ($this->shouldSendMail($object, $xactions)) { 461 461 $mail = $this->sendMail($object, $xactions); 462 462 } 463 463 ··· 1069 1069 /** 1070 1070 * @task mail 1071 1071 */ 1072 - protected function supportsMail() { 1072 + protected function shouldSendMail( 1073 + PhabricatorLiskDAO $object, 1074 + array $xactions) { 1073 1075 return false; 1074 1076 } 1075 1077