1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10:42:41 +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:
Bob Trahan 2013-09-13 15:08:17 -07:00
parent a26d3cc3c8
commit ba37594362
9 changed files with 44 additions and 10 deletions

View file

@ -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;
}

View file

@ -36,7 +36,9 @@ final class PhabricatorFileEditor
PhabricatorApplicationTransaction $xaction) {
}
protected function supportsMail() {
protected function shouldSendMail(
PhabricatorLiskDAO $object,
array $xactions) {
return true;
}

View file

@ -122,7 +122,9 @@ final class LegalpadDocumentEditor
/* -( Sending Mail )------------------------------------------------------- */
protected function supportsMail() {
protected function shouldSendMail(
PhabricatorLiskDAO $object,
array $xactions) {
return true;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -165,7 +165,9 @@ final class PonderQuestionEditor
return parent::shouldImplyCC($object, $xaction);
}
protected function supportsMail() {
protected function shouldSendMail(
PhabricatorLiskDAO $object,
array $xactions) {
return true;
}

View file

@ -155,7 +155,9 @@ final class ReleephRequestTransactionalEditor
return parent::filterTransactions($object, $xactions);
}
protected function supportsMail() {
protected function shouldSendMail(
PhabricatorLiskDAO $object,
array $xactions) {
return true;
}

View file

@ -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;
}