Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Show federation and email results also with exact user match unless c…
…ontaining @

Before when you have a user "smith" and a federated user "[email protected]"
you could see the federation result with "smit" but not with "smith" anymore.
With most LDAP configurations and local backend setups this is disturbing and
causes issues.
The idea of not showing the email and federation on a matching user was with:
Local user registered with "[email protected]" user id and having that same
email / cloud id in your contacts addressbook. So we now only hide those
"side results" when the search does contain an @

Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Sep 23, 2020
commit 5415eeda43e5c459eb99272b28b291efb78c1d74
5 changes: 3 additions & 2 deletions lib/private/Collaboration/Collaborators/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,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