Differential D13219 Diff 32428 src/applications/notification/controller/PhabricatorNotificationIndividualController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/notification/controller/PhabricatorNotificationIndividualController.php
Show All 27 Lines | if ($story->getAuthorPHID() === $viewer->getPHID()) { | ||||
// of the page that are open in other tabs, but there isn't an obvious | // of the page that are open in other tabs, but there isn't an obvious | ||||
// way to do this easily. | // way to do this easily. | ||||
return $this->buildEmptyResponse(); | return $this->buildEmptyResponse(); | ||||
} | } | ||||
$builder = new PhabricatorNotificationBuilder(array($story)); | $builder = new PhabricatorNotificationBuilder(array($story)); | ||||
$content = $builder->buildView()->render(); | $content = $builder->buildView()->render(); | ||||
$dict = $builder->buildDict(); | |||||
$data = $dict[0]; | |||||
$response = array( | $response = array( | ||||
'pertinent' => true, | 'pertinent' => true, | ||||
'primaryObjectPHID' => $story->getPrimaryObjectPHID(), | 'primaryObjectPHID' => $story->getPrimaryObjectPHID(), | ||||
'desktopReady' => $data['desktopReady'], | |||||
'href' => $data['href'], | |||||
'icon' => $data['icon'], | |||||
'title' => $data['title'], | |||||
'body' => $data['body'], | |||||
'content' => hsprintf('%s', $content), | 'content' => hsprintf('%s', $content), | ||||
); | ); | ||||
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, | ||||
)); | )); | ||||
} | } | ||||
} | } |