Merge pull request 'Replace Addon class with AddonHelper' (#1607) from Art4/friendica-addons:replace-addon-class-with-addonhelper into develop

Reviewed-on: https://git.friendi.ca/friendica/friendica-addons/pulls/1607
This commit is contained in:
Philipp Holzer 2025-05-03 21:59:14 +02:00
commit 4daaf17110
2 changed files with 6 additions and 4 deletions

View file

@ -6,7 +6,6 @@
* Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
*/
use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;
@ -71,7 +70,9 @@ function libravatar_addon_admin(string &$o)
'pagan' => DI::l10n()->t('retro adventure game character'),
];
if (Addon::isEnabled('gravatar')) {
$addonHelper = DI::addonHelper();
if ($addonHelper->isAddonEnabled('gravatar')) {
$o = '<h5>' .DI::l10n()->t('Information') .'</h5><p>' .DI::l10n()->t('Gravatar addon is installed. Please disable the Gravatar addon.<br>The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') .'</p><br><br>';
}

View file

@ -8,7 +8,6 @@
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
@ -627,7 +626,9 @@ function pumpio_action(int $uid, string $uri, string $action, string $content =
function pumpio_sync()
{
if (!Addon::isEnabled('pumpio')) {
$addonHelper = DI::addonHelper();
if (!$addonHelper->isAddonEnabled('pumpio')) {
return;
}