Differential D12186 Diff 29293 src/applications/diffusion/controller/DiffusionInlineCommentPreviewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionInlineCommentPreviewController.php
| <?php | <?php | ||||
| final class DiffusionInlineCommentPreviewController | final class DiffusionInlineCommentPreviewController | ||||
| extends PhabricatorInlineCommentPreviewController { | extends PhabricatorInlineCommentPreviewController { | ||||
| private $commitPHID; | protected function loadInlineComments() { | ||||
| $viewer = $this->getViewer(); | |||||
| public function willProcessRequest(array $data) { | return PhabricatorAuditInlineComment::loadDraftComments( | ||||
| $this->commitPHID = $data['phid']; | $viewer, | ||||
| $this->getCommitPHID()); | |||||
| } | } | ||||
| protected function loadInlineComments() { | protected function loadObjectOwnerPHID() { | ||||
| $user = $this->getRequest()->getUser(); | $viewer = $this->getViewer(); | ||||
| $commit = id(new DiffusionCommitQuery()) | |||||
| ->setViewer($viewer) | |||||
| ->withPHIDs(array($this->getCommitPHID())) | |||||
| ->executeOne(); | |||||
| if (!$commit) { | |||||
| return null; | |||||
| } | |||||
| $inlines = PhabricatorAuditInlineComment::loadDraftComments( | return $commit->getAuthorPHID(); | ||||
| $user, | } | ||||
| $this->commitPHID); | |||||
| return $inlines; | private function getCommitPHID() { | ||||
| return $this->getRequest()->getURIData('phid'); | |||||
| } | } | ||||
| } | } | ||||