]> 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 baa99c21e052c51176d486dd16d9a44873a313a7..1b64ebcd41443203b04d10313623f9c9bdba42bd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, 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;
@@ -34,21 +33,21 @@ use Friendica\Network\HTTPException;
  */
 class Follow extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $l10n = DI::l10n();
 
-               if (!Session::isAuthenticated()) {
+               if (!DI::userSession()->isAuthenticated()) {
                        throw new HttpException\ForbiddenException($l10n->t('Access denied.'));
                }
 
-               if (empty(static::$parameters['id'])) {
+               if (empty($this->parameters['id'])) {
                        throw new HTTPException\BadRequestException();
                }
 
-               $itemId = intval(static::$parameters['id']);
+               $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.'));
                }