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

@ -25,7 +25,6 @@ use Friendica\BaseModule;
use Friendica\Content\Pager;
use Friendica\Content\Widget;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Model;
use Friendica\Model\User;
@ -36,7 +35,7 @@ class Contacts extends BaseModule
{
protected function content(array $request = []): string
{
if (!Session::getLocalUser()) {
if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException();
}
@ -54,7 +53,7 @@ class Contacts extends BaseModule
throw new HTTPException\NotFoundException(DI::l10n()->t('Contact not found.'));
}
$localContactId = Model\Contact::getPublicIdByUserId(Session::getLocalUser());
$localContactId = Model\Contact::getPublicIdByUserId(DI::userSession()->getLocalUserId());
DI::page()['aside'] = Widget\VCard::getHTML($contact);