Skip to content

Commit 5415eed

Browse files
committed
Show federation and email results also with exact user match unless containing @
Before when you have a user "smith" and a federated user "smith@example.com" 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 "smith@example.com" 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 <coding@schilljs.com>
1 parent 7d06027 commit 5415eed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/private/Collaboration/Collaborators/Search.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ public function search($search, array $shareTypes, $lookup, $limit, $offset) {
9191
$searchResult->unsetResult($emailType);
9292
}
9393

94-
// if we have an exact local user match, there is no need to show the remote and email matches
94+
// if we have an exact local user match with an email-a-like query,
95+
// there is no need to show the remote and email matches.
9596
$userType = new SearchResultType('users');
96-
if ($searchResult->hasExactIdMatch($userType)) {
97+
if (strpos($search, '@') !== false && $searchResult->hasExactIdMatch($userType)) {
9798
$searchResult->unsetResult($remoteType);
9899
$searchResult->unsetResult($emailType);
99100
}

0 commit comments

Comments
 (0)