UserSession class [3] - Refactor src/ files excluding Module/Model

This commit is contained in:
Philipp 2022-10-20 21:22:47 +02:00
parent a11c125f81
commit b3f9cef94a
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
23 changed files with 120 additions and 133 deletions

View file

@ -32,9 +32,9 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\DI;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\Network;
@ -232,7 +232,7 @@ class Page implements ArrayAccess
*/
private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig)
{
$interval = ((Session::getLocalUser()) ? $pConfig->get(Session::getLocalUser(), 'system', 'update_interval') : 40000);
$interval = ((DI::userSession()->getLocalUserId()) ? $pConfig->get(DI::userSession()->getLocalUserId(), 'system', 'update_interval') : 40000);
// If the update is 'deactivated' set it to the highest integer number (~24 days)
if ($interval < 0) {
@ -277,7 +277,7 @@ class Page implements ArrayAccess
* being first
*/
$this->page['htmlhead'] = Renderer::replaceMacros($tpl, [
'$local_user' => Session::getLocalUser(),
'$local_user' => DI::userSession()->getLocalUserId(),
'$generator' => 'Friendica' . ' ' . App::VERSION,
'$delitem' => $l10n->t('Delete this item?'),
'$blockAuthor' => $l10n->t('Block this author? They won\'t be able to follow you nor see your public posts, and you won\'t be able to see their posts and their notifications.'),