diff options
author | Joas Schilling <coding@schilljs.com> | 2020-09-23 10:21:55 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-10-01 09:34:44 +0200 |
commit | af2868cb0e8b7b60f6cf9e2442ff5a17e9b9eb26 (patch) | |
tree | c2467e0cf3e54ed10b56668c90004618ab9094bb | |
parent | f121adedc133deba508cfebf245c832a901e0993 (diff) | |
download | nextcloud-server-af2868cb0e8b7b60f6cf9e2442ff5a17e9b9eb26.tar.gz nextcloud-server-af2868cb0e8b7b60f6cf9e2442ff5a17e9b9eb26.zip |
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>
-rw-r--r-- | lib/private/Collaboration/Collaborators/Search.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/Collaboration/Collaborators/Search.php b/lib/private/Collaboration/Collaborators/Search.php index 69027e7b553..788804971a3 100644 --- a/lib/private/Collaboration/Collaborators/Search.php +++ b/lib/private/Collaboration/Collaborators/Search.php @@ -88,9 +88,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); } |