API: Only search for direct hit without offset

This commit is contained in:
Michael 2022-12-06 18:47:43 +00:00
parent 215c332a94
commit 6965614f00
2 changed files with 5 additions and 4 deletions

View file

@ -108,7 +108,7 @@ class Search extends BaseApi
private static function searchAccounts(int $uid, string $q, bool $resolve, int $limit, int $offset, bool $following)
{
if (
(strrpos($q, '@') > 0 || Network::isValidHttpUrl($q))
($offset == 0) && (strrpos($q, '@') > 0 || Network::isValidHttpUrl($q))
&& $id = Contact::getIdForURL($q, 0, $resolve ? null : false)
) {
return DI::mstdnAccount()->createFromContactId($id, $uid);