Replace calls for App::getProfileOwner() with AppHelper

This commit is contained in:
Art4 2024-11-08 22:45:14 +00:00
parent 6a6a5af3b2
commit 6f14645a5f
2 changed files with 4 additions and 8 deletions

View file

@ -7,7 +7,6 @@
namespace Friendica\Model; namespace Friendica\Model;
use Friendica\App;
use Friendica\App\Mode; use Friendica\App\Mode;
use Friendica\AppHelper; use Friendica\AppHelper;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
@ -191,7 +190,6 @@ class Profile
* the theme is chosen before the _init() function of a theme is run, which will usually * the theme is chosen before the _init() function of a theme is run, which will usually
* load a lot of theme-specific content * load a lot of theme-specific content
* *
* @param App $a
* @param string $nickname string * @param string $nickname string
* @param bool $show_contacts * @param bool $show_contacts
* *
@ -688,15 +686,13 @@ class Profile
* settings take precedence; unless a local user is logged in which means they don't * settings take precedence; unless a local user is logged in which means they don't
* want to see anybody else's theme settings except their own while on this site. * want to see anybody else's theme settings except their own while on this site.
* *
* @param App $a
*
* @return int user ID * @return int user ID
* *
* @note Returns local_user instead of user ID if "always_my_theme" is set to true * @note Returns local_user instead of user ID if "always_my_theme" is set to true
*/ */
public static function getThemeUid(App $a): int public static function getThemeUid(AppHelper $appHelper): int
{ {
return DI::userSession()->getLocalUserId() ?: $a->getProfileOwner(); return DI::userSession()->getLocalUserId() ?: $appHelper->getProfileOwner();
} }
/** /**

View file

@ -57,7 +57,7 @@ class Thread
return; return;
} }
$a = DI::app(); $appHelper = DI::apphelper();
switch ($mode) { switch ($mode) {
case Conversation::MODE_NETWORK: case Conversation::MODE_NETWORK:
@ -67,7 +67,7 @@ class Thread
break; break;
case Conversation::MODE_PROFILE: case Conversation::MODE_PROFILE:
case Conversation::MODE_DISPLAY: case Conversation::MODE_DISPLAY:
$this->profile_owner = $a->getProfileOwner(); $this->profile_owner = $appHelper->getProfileOwner();
$this->writable = Security::canWriteToUserWall($this->profile_owner) || $writable; $this->writable = Security::canWriteToUserWall($this->profile_owner) || $writable;
break; break;
case Conversation::MODE_CHANNEL: case Conversation::MODE_CHANNEL: