]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Item/Follow.php
render max_imagesize in header.tpl
[friendica.git] / src / Module / Item / Follow.php
index d3df85298fa8edc67c6ea1e28ced185380bf67a3..1b64ebcd41443203b04d10313623f9c9bdba42bd 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 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.'));
                }