Modernize DifferentialInlineCommentQuery

Summary:
Ref T7447. This class is currently a big mess with a lot of `withWeirdSpecialThingUsedInOnePlace()` type qualifiers.

Try to generalize/normalize it a bit.

Test Plan:
- Viewed inline comments.
- Created a new inline comment.
- Edited an inline comment.
- Marked an inline comment complete.
- Deleted, then undeleted an inline comment.
- Previewed inline comments.
- Viewed drafts as another user, verified they don't show up.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: yelirekim, epriestley

Maniphest Tasks: T7447

Differential Revision: https://secure.phabricator.com/D12483
This commit is contained in:
epriestley
2015-04-20 14:33:58 -07:00
parent 2fab72d43b
commit 5645a07d99
6 changed files with 84 additions and 92 deletions

View File

@@ -96,7 +96,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$props = mpull($props, 'getData', 'getName');
$all_changesets = $changesets;
$inlines = $revision->loadInlineComments($all_changesets);
$inlines = $revision->loadInlineComments($all_changesets, $user);
$object_phids = array_merge(
$revision->getReviewers(),
@@ -158,7 +158,10 @@ final class DifferentialRevisionViewController extends DifferentialController {
$warning = $warning->render();
$my_inlines = id(new DifferentialInlineCommentQuery())
->withDraftComments($user->getPHID(), $this->revisionID)
->setViewer($user)
->withDrafts(true)
->withAuthorPHIDs(array($user->getPHID()))
->withRevisionPHIDs(array($revision->getPHID()))
->execute();
$visible_changesets = array();