Merge pull request #4353 from pixelfed/staging

Staging
This commit is contained in:
daniel 2023-05-05 03:06:32 -06:00 committed by GitHub
commit 7e2bad3df6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 19 deletions

View file

@ -96,9 +96,10 @@ class SearchApiV2Service
$webfingerQuery = '@' . $webfingerQuery; $webfingerQuery = '@' . $webfingerQuery;
} }
$banned = InstanceService::getBannedDomains(); $banned = InstanceService::getBannedDomains();
$operator = config('database.default') === 'pgsql' ? 'ilike' : 'like';
$results = Profile::select('username', 'id', 'followers_count', 'domain') $results = Profile::select('username', 'id', 'followers_count', 'domain')
->where('username', 'like', $query) ->where('username', $operator, $query)
->orWhere('webfinger', 'like', $webfingerQuery) ->orWhere('webfinger', $operator, $webfingerQuery)
->orderByDesc('profiles.followers_count') ->orderByDesc('profiles.followers_count')
->offset($offset) ->offset($offset)
->limit($limit) ->limit($limit)
@ -160,23 +161,8 @@ class SearchApiV2Service
protected function statusesById() protected function statusesById()
{ {
$mastodonMode = self::$mastodonMode; // Removed until we provide more relevent sorting/results
$accountId = $this->query->input('account_id'); return [];
$limit = $this->query->input('limit', 20);
$query = '%' . $this->query->input('q') . '%';
$results = Status::where('caption', 'like', $query)
->whereProfileId($accountId)
->limit($limit)
->get()
->map(function($status) use($mastodonMode) {
return $mastodonMode ?
StatusService::getMastodon($status->id) :
StatusService::get($status->id);
})
->filter(function($status) {
return $status && isset($status['account']);
});
return $results;
} }
protected function resolveQuery() protected function resolveQuery()

BIN
public/js/spa.js vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB