X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mastodoncustomemojis%2Fmastodoncustomemojis.php;h=eeada86256dd361267f359812252d7ecfb721f0e;hb=7777f080475df3218c851bd48ab609bcc54a071d;hp=6d8a6816e77b536343d59c8a59dbbc3afe16897c;hpb=191e298504f04088ca50e39010af97ece8a2f805;p=friendica-addons.git diff --git a/mastodoncustomemojis/mastodoncustomemojis.php b/mastodoncustomemojis/mastodoncustomemojis.php index 6d8a6816..eeada862 100644 --- a/mastodoncustomemojis/mastodoncustomemojis.php +++ b/mastodoncustomemojis/mastodoncustomemojis.php @@ -12,11 +12,9 @@ use Friendica\App; use Friendica\Content\Smilies; use Friendica\Core\Cache\Duration; -use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\Protocol; use Friendica\DI; -use Friendica\Util\Network; use Friendica\Util\Proxy as ProxyUtils; function mastodoncustomemojis_install() @@ -29,16 +27,6 @@ function mastodoncustomemojis_install() Hook::register('contacts_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); } -function mastodoncustomemojis_uninstall() -{ - Hook::unregister('put_item_in_cache', __FILE__, 'mastodoncustomemojis_put_item_in_cache'); - Hook::unregister('network_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Hook::unregister('display_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Hook::unregister('search_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Hook::unregister('community_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Hook::unregister('contacts_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); -} - function mastodoncustomemojis_css_hook(App $a) { DI::page()['htmlhead'] .= <<get($cache_key); - if (empty($return) || Config::get('system', 'ignore_cache')) { + if (empty($return) || DI::config()->get('system', 'ignore_cache')) { $return = mastodoncustomemojis_fetch_custom_emojis_for_url($api_base_url); DI::cache()->set($cache_key, $return, empty($return['texts']) ? Duration::QUARTER_HOUR : Duration::HOUR); @@ -91,7 +79,7 @@ function mastodoncustomemojis_fetch_custom_emojis_for_url($api_base_url) $api_url = $api_base_url . '/api/v1/custom_emojis'; - $fetchResult = Network::fetchUrlFull($api_url); + $fetchResult = DI::httpRequest()->fetchFull($api_url); if ($fetchResult->isSuccess()) { $emojis_array = json_decode($fetchResult->getBody(), true);