]> git.mxchange.org Git - friendica.git/blobdiff - mod/match.php
The item notifications now are based upon the "user-item" field
[friendica.git] / mod / match.php
index 2b3c7ca525b695ae45571afb9e9f193676869301..6fa31f0132f1c95ac9760c7f9c172b7e566e7e4d 100644 (file)
@@ -4,13 +4,13 @@
  */
 
 use Friendica\App;
-use Friendica\Content\Pager;
 use Friendica\Content\Widget;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
-use Friendica\Core\System;
+use Friendica\Core\Search;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Profile;
 use Friendica\Util\Network;
@@ -35,10 +35,10 @@ function match_content(App $a)
                return '';
        }
 
-       $a->page['aside'] .= Widget::findPeople();
-       $a->page['aside'] .= Widget::follow();
+       DI::page()['aside'] .= Widget::findPeople();
+       DI::page()['aside'] .= Widget::follow();
 
-       $_SESSION['return_path'] = $a->cmd;
+       $_SESSION['return_path'] = DI::args()->getCommand();
 
        $profile = Profile::getByUID(local_user());
 
@@ -57,16 +57,16 @@ function match_content(App $a)
        $params['n'] = 100;
 
        if (strlen(Config::get('system', 'directory'))) {
-               $host = get_server();
+               $host = Search::getGlobalDirectory();
        } else {
-               $host = System::baseUrl();
+               $host = DI::baseUrl();
        }
 
        $msearch_json = Network::post($host . '/msearch', $params)->getBody();
 
        $msearch = json_decode($msearch_json);
 
-       $start = defaults($_GET, 'start', 0);
+       $start = $_GET['start'] ?? 0;
        $entries = [];
        $paginate = '';
 
@@ -80,9 +80,9 @@ function match_content(App $a)
                        }
 
                        // Workaround for wrong directory photo URL
-                       $profile->photo = str_replace('http:///photo/', get_server() . '/photo/', $profile->photo);
+                       $profile->photo = str_replace('http:///photo/', Search::getGlobalDirectory() . '/photo/', $profile->photo);
 
-                       $connlnk = System::baseUrl() . '/follow/?url=' . $profile->url;
+                       $connlnk = DI::baseUrl() . '/follow/?url=' . $profile->url;
                        $photo_menu = [
                                'profile' => [L10n::t("View Profile"), Contact::magicLink($profile->url)],
                                'follow' => [L10n::t("Connect/Follow"), $connlnk]
@@ -92,11 +92,11 @@ function match_content(App $a)
 
                        $entry = [
                                'url'          => Contact::magicLink($profile->url),
-                               'itemurl'      => defaults($contact_details, 'addr', $profile->url),
+                               'itemurl'      => $contact_details['addr'] ?? $profile->url,
                                'name'         => $profile->name,
-                               'details'      => defaults($contact_details, 'location', ''),
-                               'tags'         => defaults($contact_details, 'keywords', ''),
-                               'about'        => defaults($contact_details, 'about', ''),
+                               'details'      => $contact_details['location'] ?? '',
+                               'tags'         => $contact_details['keywords'] ?? '',
+                               'about'        => $contact_details['about'] ?? '',
                                'account_type' => Contact::getAccountType($contact_details),
                                'thumb'        => ProxyUtils::proxifyUrl($profile->photo, false, ProxyUtils::SIZE_THUMB),
                                'conntxt'      => L10n::t('Connect'),