@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.

Update Notifications for handleRequest

Summary: Updates Notifcations for handleRequest

Test Plan: Test as much as I could, mark all, view, lists.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T8628

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

+20 -28
+4 -5
src/applications/notification/controller/PhabricatorNotificationClearController.php
··· 3 3 final class PhabricatorNotificationClearController 4 4 extends PhabricatorNotificationController { 5 5 6 - public function processRequest() { 7 - $request = $this->getRequest(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 8 8 $chrono_key = $request->getStr('chronoKey'); 9 - $user = $request->getUser(); 10 9 11 10 if ($request->isDialogFormPost()) { 12 11 $table = new PhabricatorFeedStoryNotification(); ··· 16 15 'UPDATE %T SET hasViewed = 1 '. 17 16 'WHERE userPHID = %s AND hasViewed = 0 and chronologicalKey <= %s', 18 17 $table->getTableName(), 19 - $user->getPHID(), 18 + $viewer->getPHID(), 20 19 $chrono_key); 21 20 22 21 return id(new AphrontReloadResponse()) ··· 24 23 } 25 24 26 25 $dialog = new AphrontDialogView(); 27 - $dialog->setUser($user); 26 + $dialog->setUser($viewer); 28 27 $dialog->addCancelButton('/notification/'); 29 28 if ($chrono_key) { 30 29 $dialog->setTitle(pht('Really mark all notifications as read?'));
+2 -3
src/applications/notification/controller/PhabricatorNotificationIndividualController.php
··· 3 3 final class PhabricatorNotificationIndividualController 4 4 extends PhabricatorNotificationController { 5 5 6 - public function processRequest() { 7 - $request = $this->getRequest(); 8 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 9 8 10 9 $stories = id(new PhabricatorNotificationQuery()) 11 10 ->setViewer($viewer)
+5 -9
src/applications/notification/controller/PhabricatorNotificationListController.php
··· 3 3 final class PhabricatorNotificationListController 4 4 extends PhabricatorNotificationController { 5 5 6 - private $queryKey; 7 - 8 - public function willProcessRequest(array $data) { 9 - $this->queryKey = idx($data, 'queryKey'); 10 - } 6 + public function handleRequest(AphrontRequest $request) { 7 + $querykey = $request->getURIData('queryKey'); 11 8 12 - public function processRequest() { 13 9 $controller = id(new PhabricatorApplicationSearchController()) 14 - ->setQueryKey($this->queryKey) 10 + ->setQueryKey($querykey) 15 11 ->setSearchEngine(new PhabricatorNotificationSearchEngine()) 16 12 ->setNavigation($this->buildSideNavView()); 17 13 ··· 19 15 } 20 16 21 17 public function buildSideNavView() { 22 - $user = $this->getRequest()->getUser(); 18 + $viewer = $this->getViewer(); 23 19 24 20 $nav = new AphrontSideNavFilterView(); 25 21 $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 26 22 27 23 id(new PhabricatorNotificationSearchEngine()) 28 - ->setViewer($user) 24 + ->setViewer($viewer) 29 25 ->addNavigationItems($nav->getMenu()); 30 26 $nav->selectFilter(null); 31 27
+5 -7
src/applications/notification/controller/PhabricatorNotificationPanelController.php
··· 3 3 final class PhabricatorNotificationPanelController 4 4 extends PhabricatorNotificationController { 5 5 6 - public function processRequest() { 7 - 8 - $request = $this->getRequest(); 9 - $user = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 10 8 11 9 $query = id(new PhabricatorNotificationQuery()) 12 - ->setViewer($user) 13 - ->withUserPHIDs(array($user->getPHID())) 10 + ->setViewer($viewer) 11 + ->withUserPHIDs(array($viewer->getPHID())) 14 12 ->setLimit(15); 15 13 16 14 $stories = $query->execute(); ··· 81 79 $connection_ui); 82 80 83 81 $unread_count = id(new PhabricatorFeedStoryNotification()) 84 - ->countUnread($user); 82 + ->countUnread($viewer); 85 83 86 84 $json = array( 87 85 'content' => $content,
+2 -1
src/applications/notification/controller/PhabricatorNotificationStatusController.php
··· 3 3 final class PhabricatorNotificationStatusController 4 4 extends PhabricatorNotificationController { 5 5 6 - public function processRequest() { 6 + public function handleRequest(AphrontRequest $request) { 7 + 7 8 try { 8 9 $status = PhabricatorNotificationClient::getServerStatus(); 9 10 $status = $this->renderServerStatus($status);
+2 -3
src/applications/notification/controller/PhabricatorNotificationTestController.php
··· 3 3 final class PhabricatorNotificationTestController 4 4 extends PhabricatorNotificationController { 5 5 6 - public function processRequest() { 7 - $request = $this->getRequest(); 8 - $viewer = $request->getUser(); 6 + public function handleRequest(AphrontRequest $request) { 7 + $viewer = $request->getViewer(); 9 8 10 9 $story_type = 'PhabricatorNotificationTestFeedStory'; 11 10 $story_data = array(