]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/BaseSearch.php
Remove dependency on DI in Notifications\Ping module
[friendica.git] / src / Module / BaseSearch.php
index 276598131b6411513fef1eb3b1fae9655bf519d1..b0f03c17d065377d7a58487c88654e723b83e975 100644 (file)
@@ -82,10 +82,10 @@ class BaseSearch extends BaseModule
                $search = Network::convertToIdn($search);
 
                if (DI::mode()->isMobile()) {
-                       $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
+                       $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
                                DI::config()->get('system', 'itemspage_network_mobile'));
                } else {
-                       $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
+                       $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
                                DI::config()->get('system', 'itemspage_network'));
                }
 
@@ -116,7 +116,7 @@ class BaseSearch extends BaseModule
        protected static function printResult(ResultList $results, Pager $pager, string $header = ''): string
        {
                if ($results->getTotal() == 0) {
-                       notice(DI::l10n()->t('No matches'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('No matches'));
                        return '';
                }
 
@@ -125,7 +125,7 @@ class BaseSearch extends BaseModule
 
                        // in case the result is a contact result, add a contact-specific entry
                        if ($result instanceof ContactResult) {
-                               $contact = Model\Contact::getByURLForUser($result->getUrl(), local_user());
+                               $contact = Model\Contact::getByURLForUser($result->getUrl(), DI::userSession()->getLocalUserId());
                                if (!empty($contact)) {
                                        $entries[] = Contact::getContactTemplateVars($contact);
                                }