Differential D18984 Diff 45535 src/applications/metamta/herald/PhabricatorMetaMTAEmailHeraldAction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/herald/PhabricatorMetaMTAEmailHeraldAction.php
<?php | <?php | ||||
abstract class PhabricatorMetaMTAEmailHeraldAction | abstract class PhabricatorMetaMTAEmailHeraldAction | ||||
extends HeraldAction { | extends HeraldAction { | ||||
const DO_SEND = 'do.send'; | const DO_SEND = 'do.send'; | ||||
const DO_FORCE = 'do.force'; | const DO_FORCE = 'do.force'; | ||||
public function getRequiredAdapterStates() { | public function getRequiredAdapterStates() { | ||||
return array( | return array( | ||||
HeraldMailableState::STATECONST, | HeraldMailableState::STATECONST, | ||||
); | ); | ||||
} | } | ||||
public function supportsObject($object) { | public function supportsObject($object) { | ||||
return self::isMailGeneratingObject($object); | |||||
} | |||||
public static function isMailGeneratingObject($object) { | |||||
// NOTE: This implementation lacks generality, but there's no great way to | // NOTE: This implementation lacks generality, but there's no great way to | ||||
// figure out if something generates email right now. | // figure out if something generates email right now. | ||||
if ($object instanceof DifferentialDiff) { | if ($object instanceof DifferentialDiff) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($object instanceof PhabricatorMetaMTAMail) { | if ($object instanceof PhabricatorMetaMTAMail) { | ||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |