Fix " Call to undefined method Friendica\App::getLoggedInUserNickname"
authorMichael <heluecht@pirati.ca>
Wed, 15 May 2024 06:15:50 +0000 (06:15 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 15 May 2024 06:15:50 +0000 (06:15 +0000)
src/Module/Calendar/Event/Get.php

index 6b8f620..8b76c92 100644 (file)
 namespace Friendica\Module\Calendar\Event;
 
 use Friendica\App;
-use Friendica\Content\Feature;
 use Friendica\Core\L10n;
 use Friendica\Core\Session\Capability\IHandleUserSessions;
-use Friendica\Core\System;
 use Friendica\Model\Event;
 use Friendica\Model\Item;
 use Friendica\Model\Post;
-use Friendica\Model\User;
 use Friendica\Module\Response;
 use Friendica\Network\HTTPException;
 use Friendica\Util\DateTimeFormat;
@@ -46,17 +43,16 @@ class Get extends \Friendica\BaseModule
        /** @var IHandleUserSessions */
        protected $session;
 
-       public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, 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);
 
                $this->session = $session;
-               $this->app     = $app;
        }
 
        protected function rawContent(array $request = [])
        {
-               $nickname = $this->parameters['nickname'] ?? $this->app->getLoggedInUserNickname();
+               $nickname = $this->parameters['nickname'] ?? $this->session->getLocalUserNickname();
                if (!$nickname) {
                        throw new HTTPException\UnauthorizedException();
                }