]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/BaseNotifications.php
Changes:
[friendica.git] / src / Module / BaseNotifications.php
index 1190e046dfb6ea8742db87fa4a1a4fd258adae1d..a6a2ea8d1e8eeecc69128a7933b4d0aa4c23579d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -28,6 +28,7 @@ use Friendica\BaseModule;
 use Friendica\Content\Pager;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
 use Friendica\Core\System;
 use Friendica\Navigation\Notifications\ValueObject\FormattedNotify;
 use Friendica\Network\HTTPException\ForbiddenException;
@@ -89,11 +90,11 @@ abstract class BaseNotifications extends BaseModule
         */
        abstract public function getNotifications();
 
-       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = [])
        {
                parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
-               if (!local_user()) {
+               if (!$session->getLocalUserId()) {
                        throw new ForbiddenException($this->t('Permission denied.'));
                }
 
@@ -120,7 +121,7 @@ abstract class BaseNotifications extends BaseModule
                        'page'          => $pager->getPage(),
                ];
 
-               System::jsonExit($notifications);
+               $this->jsonExit($notifications);
        }
 
        /**
@@ -157,7 +158,7 @@ abstract class BaseNotifications extends BaseModule
        /**
         * List of pages for the Notifications TabBar
         *
-        * @return array with with notifications TabBar data
+        * @return array with notifications TabBar data
         * @throws Exception
         */
        private function getTabs()