X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FSearch.php;h=98517361ea34c48a373fcc50380719800a88d9c6;hb=34521c228bd69609fa4f475bb2e2e826723fcc16;hp=4b3bb1c7cfa893306b4248d277ae421813b87ed9;hpb=8ebee968a691c13942060346ae2938ef0f481d38;p=friendica.git diff --git a/src/Core/Search.php b/src/Core/Search.php index 4b3bb1c7cf..98517361ea 100644 --- a/src/Core/Search.php +++ b/src/Core/Search.php @@ -42,7 +42,7 @@ class Search const DEFAULT_DIRECTORY = 'https://dir.friendica.social'; const TYPE_PEOPLE = 0; - const TYPE_FORUM = 1; + const TYPE_GROUP = 1; const TYPE_ALL = 2; /** @@ -55,7 +55,7 @@ class Search * @throws HTTPException\InternalServerErrorException * @throws \ImagickException */ - public static function getContactsFromProbe(string $user, $only_forum = false): ResultList + public static function getContactsFromProbe(string $user, $only_group = false): ResultList { $emptyResultList = new ResultList(); @@ -68,7 +68,7 @@ class Search return $emptyResultList; } - if ($only_forum && ($user_data['contact-type'] != Contact::TYPE_COMMUNITY)) { + if ($only_group && ($user_data['contact-type'] != Contact::TYPE_COMMUNITY)) { return $emptyResultList; } @@ -112,8 +112,8 @@ class Search $searchUrl = $server . '/search'; switch ($type) { - case self::TYPE_FORUM: - $searchUrl .= '/forum'; + case self::TYPE_GROUP: + $searchUrl .= '/group'; break; case self::TYPE_PEOPLE: $searchUrl .= '/people'; @@ -174,7 +174,7 @@ class Search { Logger::info('Searching', ['search' => $search, 'type' => $type, 'start' => $start, 'itempage' => $itemPage]); - $contacts = Contact::searchByName($search, $type == self::TYPE_FORUM ? 'community' : '', true); + $contacts = Contact::searchByName($search, $type == self::TYPE_GROUP ? 'community' : '', true); $resultList = new ResultList($start, count($contacts), $itemPage); @@ -240,7 +240,9 @@ class Search $return = array_map(function ($result) { static $contactType = [ 'People' => Contact::TYPE_PERSON, + // Kept for backward compatibility 'Forum' => Contact::TYPE_COMMUNITY, + 'Group' => Contact::TYPE_COMMUNITY, 'Organization' => Contact::TYPE_ORGANISATION, 'News' => Contact::TYPE_NEWS, ];