Page MenuHomePhabricator

D12185.id29286.diff
No OneTemporary

D12185.id29286.diff

diff --git a/src/applications/differential/controller/DifferentialChangesetViewController.php b/src/applications/differential/controller/DifferentialChangesetViewController.php
--- a/src/applications/differential/controller/DifferentialChangesetViewController.php
+++ b/src/applications/differential/controller/DifferentialChangesetViewController.php
@@ -206,6 +206,7 @@
$revision_id = $diff->getRevisionID();
$can_mark = false;
+ $object_owner_phid = null;
if ($revision_id) {
$revision = id(new DifferentialRevisionQuery())
->setViewer($viewer)
@@ -213,6 +214,7 @@
->executeOne();
if ($revision) {
$can_mark = ($revision->getAuthorPHID() == $viewer->getPHID());
+ $object_owner_phid = $revision->getAuthorPHID();
}
}
@@ -221,6 +223,7 @@
->setMarkupEngine($engine)
->setShowEditAndReplyLinks(true)
->setCanMarkDone($can_mark)
+ ->setObjectOwnerPHID($object_owner_phid)
->setRange($range_s, $range_e)
->setMask($mask);
diff --git a/src/applications/differential/parser/DifferentialChangesetParser.php b/src/applications/differential/parser/DifferentialChangesetParser.php
--- a/src/applications/differential/parser/DifferentialChangesetParser.php
+++ b/src/applications/differential/parser/DifferentialChangesetParser.php
@@ -49,6 +49,7 @@
private $highlightingDisabled;
private $showEditAndReplyLinks = true;
private $canMarkDone;
+ private $objectOwnerPHID;
private $rangeStart;
private $rangeEnd;
@@ -126,6 +127,15 @@
return $this->canMarkDone;
}
+ public function setObjectOwnerPHID($phid) {
+ $this->objectOwnerPHID = $phid;
+ return $this;
+ }
+
+ public function getObjectOwnerPHID() {
+ return $this->objectOwnerPHID;
+ }
+
public static function getDefaultRendererForViewer(PhabricatorUser $viewer) {
$prefs = $viewer->loadPreferences();
$pref_unified = PhabricatorUserPreferences::PREFERENCE_DIFF_UNIFIED;
@@ -843,6 +853,7 @@
->setOriginalCharacterEncoding($encoding)
->setShowEditAndReplyLinks($this->getShowEditAndReplyLinks())
->setCanMarkDone($this->getCanMarkDone())
+ ->setObjectOwnerPHID($this->getObjectOwnerPHID())
->setHighlightingDisabled($this->highlightingDisabled);
$shield = null;
diff --git a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
--- a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
+++ b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
@@ -465,7 +465,8 @@
->setMarkupEngine($this->getMarkupEngine())
->setEditable($edit)
->setAllowReply($allow_reply)
- ->setCanMarkDone($allow_done);
+ ->setCanMarkDone($allow_done)
+ ->setObjectOwnerPHID($this->getObjectOwnerPHID());
}
diff --git a/src/applications/differential/render/DifferentialChangesetRenderer.php b/src/applications/differential/render/DifferentialChangesetRenderer.php
--- a/src/applications/differential/render/DifferentialChangesetRenderer.php
+++ b/src/applications/differential/render/DifferentialChangesetRenderer.php
@@ -32,6 +32,7 @@
private $originalCharacterEncoding;
private $showEditAndReplyLinks;
private $canMarkDone;
+ private $objectOwnerPHID;
private $highlightingDisabled;
private $oldFile = false;
@@ -334,6 +335,15 @@
return $this->canMarkDone;
}
+ public function setObjectOwnerPHID($phid) {
+ $this->objectOwnerPHID = $phid;
+ return $this;
+ }
+
+ public function getObjectOwnerPHID() {
+ return $this->objectOwnerPHID;
+ }
+
final public function renderChangesetTable($content) {
$props = null;
if ($this->shouldRenderPropertyChangeHeader()) {
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
@@ -95,6 +95,7 @@
$parser->setCanMarkDone(
($commit->getAuthorPHID()) &&
($viewer->getPHID() == $commit->getAuthorPHID()));
+ $parser->setObjectOwnerPHID($commit->getAuthorPHID());
$parser->setWhitespaceMode(
DifferentialChangesetParser::WHITESPACE_SHOW_ALL);
diff --git a/src/infrastructure/diff/PhabricatorInlineCommentController.php b/src/infrastructure/diff/PhabricatorInlineCommentController.php
--- a/src/infrastructure/diff/PhabricatorInlineCommentController.php
+++ b/src/infrastructure/diff/PhabricatorInlineCommentController.php
@@ -307,13 +307,18 @@
$handles = $this->loadViewerHandles($phids);
+ // TODO: This is not correct, but figuring it out is a little bit
+ // involved and it only affects drafts.
+ $object_owner_phid = null;
+
$view = id(new PHUIDiffInlineCommentDetailView())
->setInlineComment($inline)
->setIsOnRight($on_right)
->setMarkupEngine($engine)
->setHandles($handles)
->setEditable(true)
- ->setCanMarkDone(false);
+ ->setCanMarkDone(false)
+ ->setObjectOwnerPHID($object_owner_phid);
$view = $this->buildScaffoldForView($view);
diff --git a/src/infrastructure/diff/PhabricatorInlineCommentPreviewController.php b/src/infrastructure/diff/PhabricatorInlineCommentPreviewController.php
--- a/src/infrastructure/diff/PhabricatorInlineCommentPreviewController.php
+++ b/src/infrastructure/diff/PhabricatorInlineCommentPreviewController.php
@@ -26,13 +26,17 @@
$views = array();
foreach ($inlines as $inline) {
+ // TODO: This is incorrect, but figuring it out is somewhat involved.
+ $object_owner_phid = null;
+
$view = id(new PHUIDiffInlineCommentDetailView())
->setInlineComment($inline)
->setMarkupEngine($engine)
->setHandles($handles)
->setEditable(false)
->setPreview(true)
- ->setCanMarkDone(false);
+ ->setCanMarkDone(false)
+ ->setObjectOwnerPHID($object_owner_phid);
$views[] = $view->render();
}
$views = phutil_implode_html("\n", $views);
diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
--- a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
+++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
@@ -11,6 +11,7 @@
private $allowReply;
private $renderer;
private $canMarkDone;
+ private $objectOwnerPHID;
public function setInlineComment(PhabricatorInlineCommentInterface $comment) {
$this->inlineComment = $comment;
@@ -61,6 +62,17 @@
return $this->canMarkDone;
}
+ public function setObjectOwnerPHID($phid) {
+ $this->objectOwnerPHID = $phid;
+ return $this;
+ }
+
+ public function getObjectOwnerPHID() {
+ return $this->objectOwnerPHID;
+ }
+
+
+
public function render() {
$inline = $this->inlineComment;

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 24, 11:51 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6710709
Default Alt Text
D12185.id29286.diff (6 KB)

Event Timeline