Replace Addon class with AddonHelper in Post Object

This commit is contained in:
Art4 2025-04-28 14:07:20 +00:00
parent 2ccb62bbd8
commit f5eee2c334

View file

@ -9,7 +9,6 @@ namespace Friendica\Object;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI; use Friendica\DI;
@ -1118,12 +1117,14 @@ class Post
$conv = $this->getThread(); $conv = $this->getThread();
if ($conv->isWritable() && $this->isWritable()) { if ($conv->isWritable() && $this->isWritable()) {
$addonHelper = DI::addonHelper();
/* /*
* Hmmm, code depending on the presence of a particular addon? * Hmmm, code depending on the presence of a particular addon?
* This should be better if done by a hook * This should be better if done by a hook
*/ */
$qcomment = null; $qcomment = null;
if (Addon::isEnabled('qcomment')) { if ($addonHelper->isAddonEnabled('qcomment')) {
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words'); $words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : []; $qcomment = $words ? explode("\n", $words) : [];
} }