Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialTransactionQuery.php
Show All 14 Lines | $inlines = id(new DifferentialDiffInlineCommentQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withRevisionPHIDs(array($revision->getPHID())) | ->withRevisionPHIDs(array($revision->getPHID())) | ||||
->withAuthorPHIDs(array($viewer->getPHID())) | ->withAuthorPHIDs(array($viewer->getPHID())) | ||||
->withHasTransaction(false) | ->withHasTransaction(false) | ||||
->withIsDeleted(false) | ->withIsDeleted(false) | ||||
->needReplyToComments(true) | ->needReplyToComments(true) | ||||
->execute(); | ->execute(); | ||||
// Don't count empty inlines when considering draft state. | |||||
foreach ($inlines as $key => $inline) { | foreach ($inlines as $key => $inline) { | ||||
if ($inline->isEmptyInlineComment()) { | $inlines[$key] = DifferentialInlineComment::newFromModernComment( | ||||
$inline); | |||||
} | |||||
PhabricatorInlineComment::loadAndAttachVersionedDrafts( | |||||
$viewer, | |||||
$inlines); | |||||
// Don't count void inlines when considering draft state. | |||||
foreach ($inlines as $key => $inline) { | |||||
if ($inline->isVoidComment($viewer)) { | |||||
unset($inlines[$key]); | unset($inlines[$key]); | ||||
} | } | ||||
} | } | ||||
$inlines = mpull($inlines, 'getStorageObject'); | |||||
return $inlines; | return $inlines; | ||||
} | } | ||||
} | } |