Merge pull request #23013 from nextcloud/bugfix/noid/show-federation-results-with-the-same-name

Show federation and email results also with exact user match unless c…
This commit is contained in:
Roeland Jago Douma 2020-09-29 09:13:08 +02:00 committed by GitHub
commit 7d776091bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -91,9 +91,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);
}