$result = ['accounts' => [], 'statuses' => [], 'hashtags' => []];
if (empty($request['type']) || ($request['type'] == 'accounts')) {
- $result['accounts'] = self::searchAccounts($uid, $request['q'], $request['resolve'], $limit, $request['offset'], $request['following']);
+ $result['accounts'] = $this->searchAccounts($uid, $request['q'], $request['resolve'], $limit, $request['offset'], $request['following']);
if (!is_array($result['accounts'])) {
// Curbing the search if we got an exact result
}
if (empty($request['type']) || ($request['type'] == 'statuses')) {
- $result['statuses'] = self::searchStatuses($uid, $request['q'], $request['account_id'], $request['max_id'], $request['min_id'], $limit, $request['offset']);
+ $result['statuses'] = $this->searchStatuses($uid, $request['q'], $request['account_id'], $request['max_id'], $request['min_id'], $limit, $request['offset']);
if (!is_array($result['statuses'])) {
// Curbing the search if we got an exact result
}
if ((empty($request['type']) || ($request['type'] == 'hashtags')) && (strpos($request['q'], '@') == false)) {
- $result['hashtags'] = self::searchHashtags($request['q'], $request['exclude_unreviewed'], $limit, $request['offset'], $this->parameters['version']);
+ $result['hashtags'] = $this->searchHashtags($request['q'], $request['exclude_unreviewed'], $limit, $request['offset'], $this->parameters['version']);
}
$this->jsonExit($result);
* @throws \Friendica\Network\HTTPException\NotFoundException
* @throws \ImagickException
*/
- private static function searchAccounts(int $uid, string $q, bool $resolve, int $limit, int $offset, bool $following)
+ private function searchAccounts(int $uid, string $q, bool $resolve, int $limit, int $offset, bool $following)
{
if (($offset == 0) && (strrpos($q, '@') > 0 || Network::isValidHttpUrl($q))
&& $id = Contact::getIdForURL($q, 0, $resolve ? null : false)
* @throws \Friendica\Network\HTTPException\NotFoundException
* @throws \ImagickException
*/
- private static function searchStatuses(int $uid, string $q, string $account_id, int $max_id, int $min_id, int $limit, int $offset)
+ private function searchStatuses(int $uid, string $q, string $account_id, int $max_id, int $min_id, int $limit, int $offset)
{
if (Network::isValidHttpUrl($q)) {
// Unique post search, any offset greater than 0 should return empty result
return $statuses;
}
- private static function searchHashtags(string $q, bool $exclude_unreviewed, int $limit, int $offset, int $version): array
+ private function searchHashtags(string $q, bool $exclude_unreviewed, int $limit, int $offset, int $version): array
{
$q = ltrim($q, '#');