diff --git a/src/applications/differential/controller/changesetview/DifferentialChangesetViewController.php b/src/applications/differential/controller/changesetview/DifferentialChangesetViewController.php index db1e383d97..02dd0ca2be 100644 --- a/src/applications/differential/controller/changesetview/DifferentialChangesetViewController.php +++ b/src/applications/differential/controller/changesetview/DifferentialChangesetViewController.php @@ -202,7 +202,7 @@ final class DifferentialChangesetViewController extends DifferentialController { if ($request->isAjax()) { // TODO: This is sort of lazy, the effect is just to not render "Edit" - // links on the "standalone view". + // and "Reply" links on the "standalone view". $parser->setUser($request->getUser()); } diff --git a/src/applications/differential/parser/changeset/DifferentialChangesetParser.php b/src/applications/differential/parser/changeset/DifferentialChangesetParser.php index 8405bfd650..932ff70bc7 100644 --- a/src/applications/differential/parser/changeset/DifferentialChangesetParser.php +++ b/src/applications/differential/parser/changeset/DifferentialChangesetParser.php @@ -1497,6 +1497,7 @@ final class DifferentialChangesetParser { $edit = $user && ($comment->getAuthorPHID() == $user->getPHID()) && ($comment->isDraft()); + $allow_reply = (bool)$this->user; $on_right = $this->isCommentOnRightSideWhenDisplayed($comment); @@ -1506,6 +1507,7 @@ final class DifferentialChangesetParser { ->setHandles($this->handles) ->setMarkupEngine($this->markupEngine) ->setEditable($edit) + ->setAllowReply($allow_reply) ->render(); } diff --git a/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php b/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php index b5f77fc392..0ad9dab0bf 100644 --- a/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php +++ b/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php @@ -25,6 +25,7 @@ final class DifferentialInlineCommentView extends AphrontView { private $markupEngine; private $editable; private $preview; + private $allowReply; public function setInlineComment(PhabricatorInlineCommentInterface $comment) { $this->inlineComment = $comment; @@ -62,6 +63,11 @@ final class DifferentialInlineCommentView extends AphrontView { return $this; } + public function setAllowReply($allow_reply) { + $this->allowReply = $allow_reply; + return $this; + } + public function render() { $inline = $this->inlineComment; @@ -120,21 +126,25 @@ final class DifferentialInlineCommentView extends AphrontView { ), 'Next'); - if (!$is_synthetic) { + if ($this->allowReply) { - // NOTE: No product reason why you can't reply to these, but the reply - // mechanism currently sends the inline comment ID to the server, not - // file/line information, and synthetic comments don't have an inline - // comment ID. + if (!$is_synthetic) { + + // NOTE: No product reason why you can't reply to these, but the reply + // mechanism currently sends the inline comment ID to the server, not + // file/line information, and synthetic comments don't have an inline + // comment ID. + + $links[] = javelin_render_tag( + 'a', + array( + 'href' => '#', + 'mustcapture' => true, + 'sigil' => 'differential-inline-reply', + ), + 'Reply'); + } - $links[] = javelin_render_tag( - 'a', - array( - 'href' => '#', - 'mustcapture' => true, - 'sigil' => 'differential-inline-reply', - ), - 'Reply'); } }