Merge pull request #23088 from nextcloud/backport/23013/stable18

[stable18] Show federation and email results also with exact user match unless c…
This commit is contained in:
Roeland Jago Douma 2020-10-01 11:11:14 +02:00 committed by GitHub
commit 79660f6828
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,9 +88,10 @@ class Search implements ISearch {
$searchResult->unsetResult($emailType);
}
// if we have an exact local user match, there is no need to show the remote and email matches
// if we have an exact local user match with an email-a-like query,
// there is no need to show the remote and email matches.
$userType = new SearchResultType('users');
if($searchResult->hasExactIdMatch($userType)) {
if (strpos($search, '@') !== false && $searchResult->hasExactIdMatch($userType)) {
$searchResult->unsetResult($remoteType);
$searchResult->unsetResult($emailType);
}