]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Item/Follow.php
Changes:
[friendica.git] / src / Module / Item / Follow.php
index b12a0ac240a6afe60b10765566f7a6e57382f030..c0caa1b86dcbfb452a7f3f14c497c1b476421e2e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2024, 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 Follow extends BaseModule
        {
                $l10n = DI::l10n();
 
-               if (!Session::isAuthenticated()) {
+               if (!DI::userSession()->isAuthenticated()) {
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
@@ -48,7 +47,7 @@ class Follow extends BaseModule
 
                $itemId = intval($this->parameters['id']);
 
-               if (!Item::performActivity($itemId, 'follow', local_user())) {
+               if (!Item::performActivity($itemId, 'follow', DI::userSession()->getLocalUserId())) {
                        throw new HTTPException\BadRequestException($l10n->t('Unable to follow this item.'));
                }
 
@@ -72,6 +71,6 @@ class Follow extends BaseModule
                        'state' => 1
                ];
 
-               System::jsonExit($return);
+               $this->jsonExit($return);
        }
 }