]> git.mxchange.org Git - friendica-addons.git/blobdiff - qcomment/qcomment.php
Merge pull request 'Bluesky: Support for transmitted languages' (#1435) from heluecht...
[friendica-addons.git] / qcomment / qcomment.php
index ab81026ed705b576afe087f9efed940ac3a5a023..1b8bfcbfd0674c7cf7327edff2a7593090c7b6c6 100644 (file)
@@ -31,18 +31,18 @@ function qcomment_install()
        Hook::register('footer'             , __FILE__, 'qcomment_footer');
 }
 
-function qcomment_footer(App $a, string &$body)
+function qcomment_footer(string &$body)
 {
        DI::page()->registerFooterScript('addon/qcomment/qcomment.js');
 }
 
-function qcomment_addon_settings(App &$a, array &$data)
+function qcomment_addon_settings(array &$data)
 {
-       if (!local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                return;
        }
 
-       $words = DI::pConfig()->get(local_user(), 'qcomment', 'words', DI::l10n()->t(':-)') . "\n" . DI::l10n()->t(':-(') . "\n" . DI::l10n()->t('lol'));
+       $words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words', DI::l10n()->t(':-)') . "\n" . DI::l10n()->t(':-(') . "\n" . DI::l10n()->t('lol'));
 
        $t    = Renderer::getMarkupTemplate('settings.tpl', 'addon/qcomment/');
        $html = Renderer::replaceMacros($t, [
@@ -57,13 +57,13 @@ function qcomment_addon_settings(App &$a, array &$data)
        ];
 }
 
-function qcomment_addon_settings_post(App $a, array &$body)
+function qcomment_addon_settings_post(array &$b)
 {
-       if (!local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                return;
        }
 
        if (isset($_POST['qcomment-words'])) {
-               DI::pConfig()->set(local_user(), 'qcomment', 'words', XML::escape($_POST['qcomment-words']));
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'qcomment', 'words', XML::escape($_POST['qcomment-words']));
        }
 }