Page MenuHomePhabricator

D21232.id50568.diff
No OneTemporary

D21232.id50568.diff

diff --git a/src/applications/differential/controller/DifferentialRevisionInlinesController.php b/src/applications/differential/controller/DifferentialRevisionInlinesController.php
--- a/src/applications/differential/controller/DifferentialRevisionInlinesController.php
+++ b/src/applications/differential/controller/DifferentialRevisionInlinesController.php
@@ -24,11 +24,12 @@
$revision_uri = $revision->getURI();
$revision_title = $revision->getTitle();
- $query = id(new DifferentialInlineCommentQuery())
+ $inlines = id(new DifferentialDiffInlineCommentQuery())
->setViewer($viewer)
- ->needHidden(true)
- ->withRevisionPHIDs(array($revision->getPHID()));
- $inlines = $query->execute();
+ ->withRevisionPHIDs(array($revision->getPHID()))
+ ->withPublishedComments(true)
+ ->execute();
+ $inlines = mpull($inlines, 'newInlineCommentObject');
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($revision_monogram, $revision_uri);
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -418,7 +418,8 @@
$inlines = id(new DiffusionDiffInlineCommentQuery())
->setViewer($viewer)
->withCommitPHIDs(array($commit->getPHID()))
- ->withVisibleComments(true)
+ ->withPublishedComments(true)
+ ->withPublishableComments(true)
->execute();
$inlines = mpull($inlines, 'newInlineCommentObject');
diff --git a/src/applications/diffusion/controller/DiffusionDiffController.php b/src/applications/diffusion/controller/DiffusionDiffController.php
--- a/src/applications/diffusion/controller/DiffusionDiffController.php
+++ b/src/applications/diffusion/controller/DiffusionDiffController.php
@@ -103,7 +103,8 @@
->setViewer($viewer)
->withCommitPHIDs(array($commit->getPHID()))
->withPathIDs(array($path_id))
- ->withVisibleComments(true)
+ ->withPublishedComments(true)
+ ->withPublishableComments(true)
->execute();
$inlines = mpull($inlines, 'newInlineCommentObject');
diff --git a/src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php b/src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php
--- a/src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php
+++ b/src/infrastructure/diff/query/PhabricatorDiffInlineCommentQuery.php
@@ -5,7 +5,7 @@
private $fixedStates;
private $needReplyToComments;
- private $visibleComments;
+ private $publishedComments;
private $publishableComments;
abstract protected function buildInlineCommentWhereClauseParts(
@@ -22,13 +22,13 @@
return $this;
}
- public function withVisibleComments($with_visible) {
- $this->visibleComments = $with_visible;
+ public function withPublishableComments($with_publishable) {
+ $this->publishableComments = $with_publishable;
return $this;
}
- public function withPublishableComments($with_publishable) {
- $this->publishableComments = $with_publishable;
+ public function withPublishedComments($with_published) {
+ $this->publishedComments = $with_published;
return $this;
}
@@ -51,32 +51,30 @@
$show_published = false;
$show_publishable = false;
- if ($this->visibleComments !== null) {
- if (!$this->visibleComments) {
+ if ($this->publishableComments !== null) {
+ if (!$this->publishableComments) {
throw new Exception(
pht(
- 'Querying for comments that are not visible is '.
+ 'Querying for comments that are "not publishable" is '.
'not supported.'));
}
- $show_published = true;
$show_publishable = true;
}
- if ($this->publishableComments !== null) {
- if (!$this->publishableComments) {
+ if ($this->publishedComments !== null) {
+ if (!$this->publishedComments) {
throw new Exception(
pht(
- 'Querying for comments that are not publishable is '.
+ 'Querying for comments that are "not published" is '.
'not supported.'));
}
- $show_publishable = true;
+ $show_published = true;
}
if ($show_publishable || $show_published) {
$clauses = array();
if ($show_published) {
- // Published comments are always visible.
$clauses[] = qsprintf(
$conn,
'%T.transactionPHID IS NOT NULL',

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 2, 12:13 AM (3 d, 20 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7382154
Default Alt Text
D21232.id50568.diff (4 KB)

Event Timeline