mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 01:02:42 +01:00
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
This commit is contained in:
parent
a26d3cc3c8
commit
ba37594362
9 changed files with 44 additions and 10 deletions
|
@ -322,7 +322,9 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
|
|||
return parent::mergeTransactions($u, $v);
|
||||
}
|
||||
|
||||
protected function supportsMail() {
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,9 @@ final class PhabricatorFileEditor
|
|||
PhabricatorApplicationTransaction $xaction) {
|
||||
}
|
||||
|
||||
protected function supportsMail() {
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,9 @@ final class LegalpadDocumentEditor
|
|||
|
||||
/* -( Sending Mail )------------------------------------------------------- */
|
||||
|
||||
protected function supportsMail() {
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,17 @@ final class PhabricatorMacroEditor
|
|||
return parent::mergeTransactions($u, $v);
|
||||
}
|
||||
|
||||
protected function supportsMail() {
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
foreach ($xactions as $xaction) {
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorMacroTransactionType::TYPE_NAME;
|
||||
return ($xaction->getOldValue() !== null);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,17 @@ final class PhabricatorPasteEditor
|
|||
}
|
||||
}
|
||||
|
||||
protected function supportsMail() {
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
foreach ($xactions as $xaction) {
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorPasteTransaction::TYPE_CREATE:
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -288,7 +288,9 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
|
|||
return parent::mergeTransactions($u, $v);
|
||||
}
|
||||
|
||||
protected function supportsMail() {
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -165,7 +165,9 @@ final class PonderQuestionEditor
|
|||
return parent::shouldImplyCC($object, $xaction);
|
||||
}
|
||||
|
||||
protected function supportsMail() {
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -155,7 +155,9 @@ final class ReleephRequestTransactionalEditor
|
|||
return parent::filterTransactions($object, $xactions);
|
||||
}
|
||||
|
||||
protected function supportsMail() {
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -457,7 +457,7 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
$this->loadHandles($xactions);
|
||||
|
||||
$mail = null;
|
||||
if ($this->supportsMail()) {
|
||||
if ($this->shouldSendMail($object, $xactions)) {
|
||||
$mail = $this->sendMail($object, $xactions);
|
||||
}
|
||||
|
||||
|
@ -1069,7 +1069,9 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
/**
|
||||
* @task mail
|
||||
*/
|
||||
protected function supportsMail() {
|
||||
protected function shouldSendMail(
|
||||
PhabricatorLiskDAO $object,
|
||||
array $xactions) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue