]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Item/Ignore.php
Merge remote-tracking branch 'upstream/develop' into inbox-gsid
[friendica.git] / src / Module / Item / Ignore.php
index 4ccc559eb306edf635b9f111eaa92b25444c2d4b..4950ba069d767728bf25ed429f1163f4bde435c8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -22,7 +22,6 @@
 namespace Friendica\Module\Item;
 
 use Friendica\BaseModule;
-use Friendica\Core\Session;
 use Friendica\Core\System;
 use Friendica\DI;
 use Friendica\Model\Item;
@@ -38,7 +37,7 @@ class Ignore extends BaseModule
        {
                $l10n = DI::l10n();
 
-               if (!Session::isAuthenticated()) {
+               if (!DI::userSession()->isAuthenticated()) {
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
@@ -55,10 +54,10 @@ class Ignore extends BaseModule
                        throw new HTTPException\NotFoundException();
                }
 
-               $ignored = !Post\ThreadUser::getIgnored($thread['uri-id'], local_user());
+               $ignored = !Post\ThreadUser::getIgnored($thread['uri-id'], DI::userSession()->getLocalUserId());
 
-               if (in_array($thread['uid'], [0, local_user()])) {
-                       Post\ThreadUser::setIgnored($thread['uri-id'], local_user(), $ignored);
+               if (in_array($thread['uid'], [0, DI::userSession()->getLocalUserId()])) {
+                       Post\ThreadUser::setIgnored($thread['uri-id'], DI::userSession()->getLocalUserId(), $ignored);
                } else {
                        throw new HTTPException\BadRequestException();
                }