Differential D21402 Diff 50942 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 4,962 Lines • ▼ Show 20 Lines | foreach ($call_hooks as $call_hook) { | ||||
->save(); | ->save(); | ||||
$request->queueCall(); | $request->queueCall(); | ||||
} | } | ||||
} | } | ||||
private function hasWarnings($object, $xaction) { | private function hasWarnings($object, $xaction) { | ||||
// TODO: For the moment, this is a very un-modular hack to support | // TODO: For the moment, this is a very un-modular hack to support | ||||
// exactly one type of warning (mentioning users on a draft revision) | // a small number of warnings related to draft revisions. See PHI433. | ||||
// that we want to show. See PHI433. | |||||
if (!($object instanceof DifferentialRevision)) { | if (!($object instanceof DifferentialRevision)) { | ||||
return false; | return false; | ||||
} | } | ||||
$type = $xaction->getTransactionType(); | $type = $xaction->getTransactionType(); | ||||
// TODO: This doesn't warn for inlines in Audit, even though they have | // TODO: This doesn't warn for inlines in Audit, even though they have | ||||
// the same overall workflow. | // the same overall workflow. | ||||
if ($type === DifferentialTransaction::TYPE_INLINE) { | if ($type === DifferentialTransaction::TYPE_INLINE) { | ||||
return (bool)$xaction->getComment()->getAttribute('editing', false); | return (bool)$xaction->getComment()->getAttribute('editing', false); | ||||
} | } | ||||
if (!$object->isDraft()) { | if (!$object->isDraft()) { | ||||
return false; | return false; | ||||
} | } | ||||
if ($type != PhabricatorTransactions::TYPE_SUBSCRIBERS) { | if ($type != PhabricatorTransactions::TYPE_SUBSCRIBERS) { | ||||
return false; | return false; | ||||
} | } | ||||
// NOTE: This will currently warn even if you're only removing | // We're only going to raise a warning if the transaction adds subscribers | ||||
// subscribers. | // other than the acting user. (This implementation is clumsy because the | ||||
// code runs before a lot of normalization occurs.) | |||||
$old = $this->getTransactionOldValue($object, $xaction); | |||||
$new = $this->getPHIDTransactionNewValue($xaction, $old); | |||||
$old = array_fuse($old); | |||||
$new = array_fuse($new); | |||||
$add = array_diff_key($new, $old); | |||||
unset($add[$this->getActingAsPHID()]); | |||||
if (!$add) { | |||||
return false; | |||||
} | |||||
return true; | return true; | ||||
} | } | ||||
private function buildHistoryMail(PhabricatorLiskDAO $object) { | private function buildHistoryMail(PhabricatorLiskDAO $object) { | ||||
$viewer = $this->requireActor(); | $viewer = $this->requireActor(); | ||||
$recipient_phid = $this->getActingAsPHID(); | $recipient_phid = $this->getActingAsPHID(); | ||||
▲ Show 20 Lines • Show All 403 Lines • Show Last 20 Lines |