@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Provide getObjectOwnerPHID() on inline comment views

Summary:
This returns the PHID of the current revision owner, or the commit author, if one exists.

NOTE: For drafts, we currently return `null`; I'll fix that in a future change. Should be correct for submitted comments.

Test Plan: Added an inline, nothing seemed broken.

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D12185

+50 -3
+3
src/applications/differential/controller/DifferentialChangesetViewController.php
··· 206 206 $revision_id = $diff->getRevisionID(); 207 207 208 208 $can_mark = false; 209 + $object_owner_phid = null; 209 210 if ($revision_id) { 210 211 $revision = id(new DifferentialRevisionQuery()) 211 212 ->setViewer($viewer) ··· 213 214 ->executeOne(); 214 215 if ($revision) { 215 216 $can_mark = ($revision->getAuthorPHID() == $viewer->getPHID()); 217 + $object_owner_phid = $revision->getAuthorPHID(); 216 218 } 217 219 } 218 220 ··· 221 223 ->setMarkupEngine($engine) 222 224 ->setShowEditAndReplyLinks(true) 223 225 ->setCanMarkDone($can_mark) 226 + ->setObjectOwnerPHID($object_owner_phid) 224 227 ->setRange($range_s, $range_e) 225 228 ->setMask($mask); 226 229
+11
src/applications/differential/parser/DifferentialChangesetParser.php
··· 49 49 private $highlightingDisabled; 50 50 private $showEditAndReplyLinks = true; 51 51 private $canMarkDone; 52 + private $objectOwnerPHID; 52 53 53 54 private $rangeStart; 54 55 private $rangeEnd; ··· 124 125 125 126 public function getCanMarkDone() { 126 127 return $this->canMarkDone; 128 + } 129 + 130 + public function setObjectOwnerPHID($phid) { 131 + $this->objectOwnerPHID = $phid; 132 + return $this; 133 + } 134 + 135 + public function getObjectOwnerPHID() { 136 + return $this->objectOwnerPHID; 127 137 } 128 138 129 139 public static function getDefaultRendererForViewer(PhabricatorUser $viewer) { ··· 843 853 ->setOriginalCharacterEncoding($encoding) 844 854 ->setShowEditAndReplyLinks($this->getShowEditAndReplyLinks()) 845 855 ->setCanMarkDone($this->getCanMarkDone()) 856 + ->setObjectOwnerPHID($this->getObjectOwnerPHID()) 846 857 ->setHighlightingDisabled($this->highlightingDisabled); 847 858 848 859 $shield = null;
+2 -1
src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
··· 465 465 ->setMarkupEngine($this->getMarkupEngine()) 466 466 ->setEditable($edit) 467 467 ->setAllowReply($allow_reply) 468 - ->setCanMarkDone($allow_done); 468 + ->setCanMarkDone($allow_done) 469 + ->setObjectOwnerPHID($this->getObjectOwnerPHID()); 469 470 } 470 471 471 472
+10
src/applications/differential/render/DifferentialChangesetRenderer.php
··· 32 32 private $originalCharacterEncoding; 33 33 private $showEditAndReplyLinks; 34 34 private $canMarkDone; 35 + private $objectOwnerPHID; 35 36 private $highlightingDisabled; 36 37 37 38 private $oldFile = false; ··· 332 333 333 334 public function getCanMarkDone() { 334 335 return $this->canMarkDone; 336 + } 337 + 338 + public function setObjectOwnerPHID($phid) { 339 + $this->objectOwnerPHID = $phid; 340 + return $this; 341 + } 342 + 343 + public function getObjectOwnerPHID() { 344 + return $this->objectOwnerPHID; 335 345 } 336 346 337 347 final public function renderChangesetTable($content) {
+1
src/applications/diffusion/controller/DiffusionDiffController.php
··· 95 95 $parser->setCanMarkDone( 96 96 ($commit->getAuthorPHID()) && 97 97 ($viewer->getPHID() == $commit->getAuthorPHID())); 98 + $parser->setObjectOwnerPHID($commit->getAuthorPHID()); 98 99 99 100 $parser->setWhitespaceMode( 100 101 DifferentialChangesetParser::WHITESPACE_SHOW_ALL);
+6 -1
src/infrastructure/diff/PhabricatorInlineCommentController.php
··· 307 307 308 308 $handles = $this->loadViewerHandles($phids); 309 309 310 + // TODO: This is not correct, but figuring it out is a little bit 311 + // involved and it only affects drafts. 312 + $object_owner_phid = null; 313 + 310 314 $view = id(new PHUIDiffInlineCommentDetailView()) 311 315 ->setInlineComment($inline) 312 316 ->setIsOnRight($on_right) 313 317 ->setMarkupEngine($engine) 314 318 ->setHandles($handles) 315 319 ->setEditable(true) 316 - ->setCanMarkDone(false); 320 + ->setCanMarkDone(false) 321 + ->setObjectOwnerPHID($object_owner_phid); 317 322 318 323 $view = $this->buildScaffoldForView($view); 319 324
+5 -1
src/infrastructure/diff/PhabricatorInlineCommentPreviewController.php
··· 26 26 27 27 $views = array(); 28 28 foreach ($inlines as $inline) { 29 + // TODO: This is incorrect, but figuring it out is somewhat involved. 30 + $object_owner_phid = null; 31 + 29 32 $view = id(new PHUIDiffInlineCommentDetailView()) 30 33 ->setInlineComment($inline) 31 34 ->setMarkupEngine($engine) 32 35 ->setHandles($handles) 33 36 ->setEditable(false) 34 37 ->setPreview(true) 35 - ->setCanMarkDone(false); 38 + ->setCanMarkDone(false) 39 + ->setObjectOwnerPHID($object_owner_phid); 36 40 $views[] = $view->render(); 37 41 } 38 42 $views = phutil_implode_html("\n", $views);
+12
src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
··· 11 11 private $allowReply; 12 12 private $renderer; 13 13 private $canMarkDone; 14 + private $objectOwnerPHID; 14 15 15 16 public function setInlineComment(PhabricatorInlineCommentInterface $comment) { 16 17 $this->inlineComment = $comment; ··· 60 61 public function getCanMarkDone() { 61 62 return $this->canMarkDone; 62 63 } 64 + 65 + public function setObjectOwnerPHID($phid) { 66 + $this->objectOwnerPHID = $phid; 67 + return $this; 68 + } 69 + 70 + public function getObjectOwnerPHID() { 71 + return $this->objectOwnerPHID; 72 + } 73 + 74 + 63 75 64 76 public function render() { 65 77