Skip to content

Commit

Permalink
Merge pull request #23088 from nextcloud/backport/23013/stable18
Browse files Browse the repository at this point in the history
[stable18] Show federation and email results also with exact user match unless c…
  • Loading branch information
rullzer authored Oct 1, 2020
2 parents 301deee + af2868c commit 79660f6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/private/Collaboration/Collaborators/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ public function search($search, array $shareTypes, $lookup, $limit, $offset) {
$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);
}
Expand Down

0 comments on commit 79660f6

Please sign in to comment.