Merge pull request #12956 from annando/server-blocked

Don't search for contacts on blocked or failed systems
This commit is contained in:
Hypolite Petovan 2023-03-29 14:58:12 -04:00 committed by GitHub
commit bc7bf77096
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 53 additions and 23 deletions

View file

@ -60,7 +60,7 @@ class Search extends BaseApi
}
if (empty($accounts)) {
$contacts = Contact::searchByName($request['q'], '', $request['following'] ? $uid : 0, $request['limit'], $request['offset']);
$contacts = Contact::searchByName($request['q'], '', false, $request['following'] ? $uid : 0, $request['limit'], $request['offset']);
foreach ($contacts as $contact) {
$accounts[] = DI::mstdnAccount()->createFromContactId($contact['id'], $uid);
}

View file

@ -115,7 +115,7 @@ class Search extends BaseApi
}
$accounts = [];
foreach (Contact::searchByName($q, '', $following ? $uid : 0, $limit, $offset) as $contact) {
foreach (Contact::searchByName($q, '', $following ? $uid : 0, false, $limit, $offset) as $contact) {
$accounts[] = DI::mstdnAccount()->createFromContactId($contact['id'], $uid);
}