UserSession class [5] - Refactor src/Module/ files with DI

This commit is contained in:
Philipp 2022-10-20 22:59:12 +02:00
parent a729f3255d
commit eecc456e0c
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
78 changed files with 455 additions and 530 deletions

View file

@ -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', Session::getLocalUser())) {
if (!Item::performActivity($itemId, 'follow', DI::userSession()->getLocalUserId())) {
throw new HTTPException\BadRequestException($l10n->t('Unable to follow this item.'));
}