Differential D18600 Diff 44661 src/applications/notification/controller/PhabricatorNotificationIndividualController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/notification/controller/PhabricatorNotificationIndividualController.php
| Show All 32 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| $builder = id(new PhabricatorNotificationBuilder(array($story))) | $builder = id(new PhabricatorNotificationBuilder(array($story))) | ||||
| ->setUser($viewer) | ->setUser($viewer) | ||||
| ->setShowTimestamps(false); | ->setShowTimestamps(false); | ||||
| $content = $builder->buildView()->render(); | $content = $builder->buildView()->render(); | ||||
| $dict = $builder->buildDict(); | $dict = $builder->buildDict(); | ||||
| $data = $dict[0]; | $data = $dict[0]; | ||||
| $response = array( | $response = $data + array( | ||||
| 'pertinent' => true, | 'pertinent' => true, | ||||
| 'primaryObjectPHID' => $story->getPrimaryObjectPHID(), | 'primaryObjectPHID' => $story->getPrimaryObjectPHID(), | ||||
| 'desktopReady' => $data['desktopReady'], | |||||
| 'webReady' => $data['webReady'], | |||||
| 'href' => $data['href'], | |||||
| 'icon' => $data['icon'], | |||||
| 'title' => $data['title'], | |||||
| 'body' => $data['body'], | |||||
| 'content' => hsprintf('%s', $content), | 'content' => hsprintf('%s', $content), | ||||
| 'uniqueID' => 'story/'.$story->getChronologicalKey(), | 'uniqueID' => 'story/'.$story->getChronologicalKey(), | ||||
| ); | ); | ||||
| return id(new AphrontAjaxResponse())->setContent($response); | return id(new AphrontAjaxResponse())->setContent($response); | ||||
| } | } | ||||
| private function buildEmptyResponse() { | private function buildEmptyResponse() { | ||||
| return id(new AphrontAjaxResponse())->setContent( | return id(new AphrontAjaxResponse())->setContent( | ||||
| array( | array( | ||||
| 'pertinent' => false, | 'pertinent' => false, | ||||
| )); | )); | ||||
| } | } | ||||
| } | } | ||||