Skip to content

Commit af2868c

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 f121ade commit af2868c

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
@@ -88,9 +88,10 @@ public function search($search, array $shareTypes, $lookup, $limit, $offset) {
8888
$searchResult->unsetResult($emailType);
8989
}
9090

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

0 commit comments

Comments
 (0)