Differential D11116 Diff 26807 src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Show First 20 Lines • Show All 1,860 Lines • ▼ Show 20 Lines | final public function applyImplicitCC( | ||||
if ($object->getPHID()) { | if ($object->getPHID()) { | ||||
if (isset($this->subscribers[$actor_phid])) { | if (isset($this->subscribers[$actor_phid])) { | ||||
// If the user is already subscribed, don't implicitly CC them. | // If the user is already subscribed, don't implicitly CC them. | ||||
return $xactions; | return $xactions; | ||||
} | } | ||||
$unsub = PhabricatorEdgeQuery::loadDestinationPHIDs( | $unsub = PhabricatorEdgeQuery::loadDestinationPHIDs( | ||||
$object->getPHID(), | $object->getPHID(), | ||||
PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER); | PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST); | ||||
$unsub = array_fuse($unsub); | $unsub = array_fuse($unsub); | ||||
if (isset($unsub[$actor_phid])) { | if (isset($unsub[$actor_phid])) { | ||||
// If the user has previously unsubscribed from this object explicitly, | // If the user has previously unsubscribed from this object explicitly, | ||||
// don't implicitly CC them. | // don't implicitly CC them. | ||||
return $xactions; | return $xactions; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | protected function getMailCC(PhabricatorLiskDAO $object) { | ||||
} | } | ||||
if ($object instanceof PhabricatorProjectInterface) { | if ($object instanceof PhabricatorProjectInterface) { | ||||
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( | $project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( | ||||
$object->getPHID(), | $object->getPHID(), | ||||
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST); | PhabricatorProjectObjectHasProjectEdgeType::EDGECONST); | ||||
if ($project_phids) { | if ($project_phids) { | ||||
$watcher_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_WATCHER; | $watcher_type = PhabricatorObjectHasWatcherEdgeType::EDGECONST; | ||||
$query = id(new PhabricatorEdgeQuery()) | $query = id(new PhabricatorEdgeQuery()) | ||||
->withSourcePHIDs($project_phids) | ->withSourcePHIDs($project_phids) | ||||
->withEdgeTypes(array($watcher_type)); | ->withEdgeTypes(array($watcher_type)); | ||||
$query->execute(); | $query->execute(); | ||||
$watcher_phids = $query->getDestinationPHIDs(); | $watcher_phids = $query->getDestinationPHIDs(); | ||||
if ($watcher_phids) { | if ($watcher_phids) { | ||||
▲ Show 20 Lines • Show All 368 Lines • ▼ Show 20 Lines | private function attachFiles( | ||||
if (!$file_phids) { | if (!$file_phids) { | ||||
return; | return; | ||||
} | } | ||||
$editor = new PhabricatorEdgeEditor(); | $editor = new PhabricatorEdgeEditor(); | ||||
$src = $object->getPHID(); | $src = $object->getPHID(); | ||||
$type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE; | $type = PhabricatorObjectHasFileEdgeType::EDGECONST; | ||||
foreach ($file_phids as $dst) { | foreach ($file_phids as $dst) { | ||||
$editor->addEdge($src, $type, $dst); | $editor->addEdge($src, $type, $dst); | ||||
} | } | ||||
$editor->save(); | $editor->save(); | ||||
} | } | ||||
private function applyInverseEdgeTransactions( | private function applyInverseEdgeTransactions( | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |