diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 3f6e07f381..9190783440 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -80,7 +80,9 @@ final class DifferentialRevisionViewController extends DifferentialController { $comments); $all_changesets = $changesets; - $inlines = $this->loadInlineComments($comments, $all_changesets); + $inlines = $this->loadInlineComments( + $revision, + $all_changesets); $object_phids = array_merge( $revision->getReviewers(), @@ -629,19 +631,16 @@ final class DifferentialRevisionViewController extends DifferentialController { return $actions_dict; } - private function loadInlineComments(array $comments, array &$changesets) { - assert_instances_of($comments, 'DifferentialComment'); + private function loadInlineComments( + DifferentialRevision $revision, + array &$changesets) { assert_instances_of($changesets, 'DifferentialChangeset'); $inline_comments = array(); - $comment_ids = array_filter(mpull($comments, 'getID')); - if (!$comment_ids) { - return $inline_comments; - } - $inline_comments = id(new DifferentialInlineCommentQuery()) - ->withCommentIDs($comment_ids) + ->withRevisionIDs(array($revision->getID())) + ->withNotDraft(true) ->execute(); $load_changesets = array(); diff --git a/src/applications/differential/query/DifferentialInlineCommentQuery.php b/src/applications/differential/query/DifferentialInlineCommentQuery.php index 49e0303d7f..9de1c56b06 100644 --- a/src/applications/differential/query/DifferentialInlineCommentQuery.php +++ b/src/applications/differential/query/DifferentialInlineCommentQuery.php @@ -30,11 +30,6 @@ final class DifferentialInlineCommentQuery return $this; } - public function withCommentIDs(array $ids) { - $this->commentIDs = $ids; - return $this; - } - public function withViewerAndChangesetIDs($author_phid, array $ids) { $this->viewerAndChangesetIDs = array($author_phid, $ids); return $this; @@ -91,13 +86,6 @@ final class DifferentialInlineCommentQuery $this->ids); } - if ($this->commentIDs) { - $where[] = qsprintf( - $conn_r, - 'commentID in (%Ld)', - $this->commentIDs); - } - if ($this->viewerAndChangesetIDs) { list($phid, $ids) = $this->viewerAndChangesetIDs; $where[] = qsprintf(