X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FSearch.php;h=c41df70d9bf5f2db39cf2712a2cdf75fab3bc121;hb=fefe9cd5c918f71c374ffbc43049a5cf7f94c475;hp=0065274a3a67e3f15c9209370c7fefbcccb1595b;hpb=4e5179a7b331c1631ba6dd3e2e076edbaf096420;p=friendica.git diff --git a/src/Core/Search.php b/src/Core/Search.php index 0065274a3a..c41df70d9b 100644 --- a/src/Core/Search.php +++ b/src/Core/Search.php @@ -70,7 +70,7 @@ class Search return $emptyResultList; } - $contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', local_user()); + $contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', DI::userSession()->getLocalUserId()); $result = new ContactResult( $user_data['name'] ?? '', @@ -102,7 +102,7 @@ class Search * @return ResultList * @throws HTTPException\InternalServerErrorException */ - public static function getContactsFromGlobalDirectory(string $search, int$type = self::TYPE_ALL, int $page = 1): ResultList + public static function getContactsFromGlobalDirectory(string $search, int $type = self::TYPE_ALL, int $page = 1): ResultList { $server = self::getGlobalDirectory(); @@ -136,7 +136,7 @@ class Search foreach ($profiles as $profile) { $profile_url = $profile['profile_url'] ?? ''; - $contactDetails = Contact::getByURLForUser($profile_url, local_user()); + $contactDetails = Contact::getByURLForUser($profile_url, DI::userSession()->getLocalUserId()); $result = new ContactResult( $profile['name'] ?? '', @@ -192,7 +192,7 @@ class Search } // Add found profiles from the global directory to the local directory - Worker::add(PRIORITY_LOW, 'SearchDirectory', $search); + Worker::add(Worker::PRIORITY_LOW, 'SearchDirectory', $search); return $resultList; } @@ -211,7 +211,7 @@ class Search { Logger::info('Searching', ['search' => $search, 'mode' => $mode, 'page' => $page]); - if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) { + if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) { return []; }