mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 18:22:41 +01:00
Slightly simplify logic for determining if an inline comment has an effect
Summary: Minor cleanup, this logic can be simpler. Instead of special-casing inlines as having an effect if the have a comment, just consider any transaction with a comment to have an effect. I'm fairly certain this is always true. Test Plan: Made inlines, tried to submit empty comments. Behavior unchanged. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D18468
This commit is contained in:
parent
6c9026c33a
commit
9639ec0dfa
2 changed files with 4 additions and 16 deletions
|
@ -107,20 +107,6 @@ final class DifferentialTransactionEditor
|
|||
return parent::getCustomTransactionNewValue($object, $xaction);
|
||||
}
|
||||
|
||||
protected function transactionHasEffect(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
||||
$actor_phid = $this->getActingAsPHID();
|
||||
|
||||
switch ($xaction->getTransactionType()) {
|
||||
case DifferentialTransaction::TYPE_INLINE:
|
||||
return $xaction->hasComment();
|
||||
}
|
||||
|
||||
return parent::transactionHasEffect($object, $xaction);
|
||||
}
|
||||
|
||||
protected function applyCustomInternalTransaction(
|
||||
PhabricatorLiskDAO $object,
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
|
|
|
@ -486,8 +486,6 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
switch ($xaction->getTransactionType()) {
|
||||
case PhabricatorTransactions::TYPE_CREATE:
|
||||
return true;
|
||||
case PhabricatorTransactions::TYPE_COMMENT:
|
||||
return $xaction->hasComment();
|
||||
case PhabricatorTransactions::TYPE_CUSTOMFIELD:
|
||||
$field = $this->getCustomFieldForTransaction($object, $xaction);
|
||||
return $field->getApplicationTransactionHasEffect($xaction);
|
||||
|
@ -534,6 +532,10 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||
$xaction->getNewValue());
|
||||
}
|
||||
|
||||
if ($xaction->hasComment()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return ($xaction->getOldValue() !== $xaction->getNewValue());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue