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

@ -23,7 +23,6 @@ namespace Friendica\Object;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Protocol\Activity;
use Friendica\Security\Security;
@ -76,7 +75,7 @@ class Thread
switch ($mode) {
case 'network':
case 'notes':
$this->profile_owner = Session::getLocalUser();
$this->profile_owner = DI::userSession()->getLocalUserId();
$this->writable = true;
break;
case 'profile':
@ -169,7 +168,7 @@ class Thread
/*
* Only add will be displayed
*/
if ($item->getDataValue('network') === Protocol::MAIL && Session::getLocalUser() != $item->getDataValue('uid')) {
if ($item->getDataValue('network') === Protocol::MAIL && DI::userSession()->getLocalUserId() != $item->getDataValue('uid')) {
Logger::info('[WARN] Conversation::addThread : Thread is a mail ('. $item->getId() .').');
return false;
}
@ -202,7 +201,7 @@ class Thread
$result = [];
foreach ($this->parents as $item) {
if ($item->getDataValue('network') === Protocol::MAIL && Session::getLocalUser() != $item->getDataValue('uid')) {
if ($item->getDataValue('network') === Protocol::MAIL && DI::userSession()->getLocalUserId() != $item->getDataValue('uid')) {
continue;
}