Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO { | ||||
} | } | ||||
/** | /** | ||||
* Load a concrete instance of the @{class:PhabricatorMailReceiver} which | * Load a concrete instance of the @{class:PhabricatorMailReceiver} which | ||||
* accepts this mail, if one exists. | * accepts this mail, if one exists. | ||||
*/ | */ | ||||
private function loadReceiver() { | private function loadReceiver() { | ||||
$receivers = id(new PhutilSymbolLoader()) | $receivers = id(new PhutilClassMapQuery()) | ||||
->setAncestorClass('PhabricatorMailReceiver') | ->setAncestorClass('PhabricatorMailReceiver') | ||||
->loadObjects(); | ->setFilterMethod('isEnabled') | ||||
->execute(); | |||||
epriestley: Variant, per above. | |||||
$accept = array(); | $accept = array(); | ||||
foreach ($receivers as $key => $receiver) { | foreach ($receivers as $key => $receiver) { | ||||
if (!$receiver->isEnabled()) { | |||||
continue; | |||||
} | |||||
if ($receiver->canAcceptMail($this)) { | if ($receiver->canAcceptMail($this)) { | ||||
$accept[$key] = $receiver; | $accept[$key] = $receiver; | ||||
} | } | ||||
} | } | ||||
if (!$accept) { | if (!$accept) { | ||||
throw new PhabricatorMetaMTAReceivedMailProcessingException( | throw new PhabricatorMetaMTAReceivedMailProcessingException( | ||||
MetaMTAReceivedMailStatus::STATUS_NO_RECEIVERS, | MetaMTAReceivedMailStatus::STATUS_NO_RECEIVERS, | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |
Variant, per above.