Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / feed / controller / PhabricatorFeedDetailController.php
blobf136d01202520b890ad57b3ad1b46b80d65de048
1 <?php
3 final class PhabricatorFeedDetailController extends PhabricatorFeedController {
5 public function handleRequest(AphrontRequest $request) {
6 $viewer = $request->getViewer();
7 $id = $request->getURIData('id');
9 $story = id(new PhabricatorFeedQuery())
10 ->setViewer($viewer)
11 ->withChronologicalKeys(array($id))
12 ->executeOne();
13 if (!$story) {
14 return new Aphront404Response();
17 if ($request->getStr('text')) {
18 $text = $story->renderText();
19 return id(new AphrontPlainTextResponse())->setContent($text);
22 $feed = array($story);
23 $builder = new PhabricatorFeedBuilder($feed);
24 $builder->setUser($viewer);
25 $feed_view = $builder->buildView();
27 $title = pht('Story');
29 $crumbs = $this->buildApplicationCrumbs();
30 $crumbs->addTextCrumb($title);
32 return $this->newPage()
33 ->setTitle($title)
34 ->setCrumbs($crumbs)
35 ->appendChild($feed_view);