Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/storage/PhabricatorMetaMTAMail.php
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | public function setExcludeMailRecipientPHIDs(array $exclude) { | ||||
$this->setParam('exclude', $exclude); | $this->setParam('exclude', $exclude); | ||||
return $this; | return $this; | ||||
} | } | ||||
private function getExcludeMailRecipientPHIDs() { | private function getExcludeMailRecipientPHIDs() { | ||||
return $this->getParam('exclude', array()); | return $this->getParam('exclude', array()); | ||||
} | } | ||||
public function setMutedPHIDs(array $muted) { | |||||
$this->setParam('muted', $muted); | |||||
return $this; | |||||
} | |||||
private function getMutedPHIDs() { | |||||
return $this->getParam('muted', array()); | |||||
} | |||||
public function setForceHeraldMailRecipientPHIDs(array $force) { | public function setForceHeraldMailRecipientPHIDs(array $force) { | ||||
$this->setParam('herald-force-recipients', $force); | $this->setParam('herald-force-recipients', $force); | ||||
return $this; | return $this; | ||||
} | } | ||||
private function getForceHeraldMailRecipientPHIDs() { | private function getForceHeraldMailRecipientPHIDs() { | ||||
return $this->getParam('herald-force-recipients', array()); | return $this->getParam('herald-force-recipients', array()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 937 Lines • ▼ Show 20 Lines | private function loadActors(array $actor_phids) { | ||||
// added them, for example. | // added them, for example. | ||||
$deliverable = array(); | $deliverable = array(); | ||||
foreach ($actors as $phid => $actor) { | foreach ($actors as $phid => $actor) { | ||||
if ($actor->isDeliverable()) { | if ($actor->isDeliverable()) { | ||||
$deliverable[] = $phid; | $deliverable[] = $phid; | ||||
} | } | ||||
} | } | ||||
// Exclude muted recipients. We're doing this after saving deliverability | |||||
// so that Herald "Send me an email" actions can still punch through a | |||||
// mute. | |||||
foreach ($this->getMutedPHIDs() as $muted_phid) { | |||||
$muted_actor = idx($actors, $muted_phid); | |||||
if (!$muted_actor) { | |||||
continue; | |||||
} | |||||
$muted_actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_MUTED); | |||||
} | |||||
// For the rest of the rules, order matters. We're going to run all the | // For the rest of the rules, order matters. We're going to run all the | ||||
// possible rules in order from weakest to strongest, and let the strongest | // possible rules in order from weakest to strongest, and let the strongest | ||||
// matching rule win. The weaker rules leave annotations behind which help | // matching rule win. The weaker rules leave annotations behind which help | ||||
// users understand why the mail was routed the way it was. | // users understand why the mail was routed the way it was. | ||||
// Exclude the actor if their preferences are set. | // Exclude the actor if their preferences are set. | ||||
$from_phid = $this->getParam('from'); | $from_phid = $this->getParam('from'); | ||||
$from_actor = idx($actors, $from_phid); | $from_actor = idx($actors, $from_phid); | ||||
▲ Show 20 Lines • Show All 398 Lines • Show Last 20 Lines |