]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Profile/Contacts.php
Create Profile\UnkMail module class
[friendica.git] / src / Module / Profile / Contacts.php
index d849d57783053566c408d61866784346021ab63d..6397ff459564f34149bffd0e93709dd25c70e5ec 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -25,7 +25,6 @@ use Friendica\Content\Nav;
 use Friendica\Content\Pager;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
-use Friendica\Core\Session;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model;
@@ -34,23 +33,23 @@ use Friendica\Network\HTTPException;
 
 class Contacts extends Module\BaseProfile
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
-               if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
+               if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
 
                $a = DI::app();
 
-               $nickname = static::$parameters['nickname'];
-               $type = static::$parameters['type'] ?? 'all';
+               $nickname = $this->parameters['nickname'];
+               $type = $this->parameters['type'] ?? 'all';
 
                $profile = Model\Profile::load($a, $nickname);
                if (empty($profile)) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
 
-               $is_owner = $profile['uid'] == local_user();
+               $is_owner = $profile['uid'] == DI::userSession()->getLocalUserId();
 
                if ($profile['hide-friends'] && !$is_owner) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -60,7 +59,7 @@ class Contacts extends Module\BaseProfile
 
                $o = self::getTabsHTML($a, 'contacts', $is_owner, $profile['nickname'], $profile['hide-friends']);
 
-               $tabs = self::getContactFilterTabs('profile/' . $nickname, $type, Session::isAuthenticated() && $profile['uid'] != local_user());
+               $tabs = self::getContactFilterTabs('profile/' . $nickname, $type, DI::userSession()->isAuthenticated() && $profile['uid'] != DI::userSession()->getLocalUserId());
 
                $condition = [
                        'uid'     => $profile['uid'],