diff --git a/lib/private/Collaboration/Collaborators/Search.php b/lib/private/Collaboration/Collaborators/Search.php index 1aabd423371df..e7773858e5c08 100644 --- a/lib/private/Collaboration/Collaborators/Search.php +++ b/lib/private/Collaboration/Collaborators/Search.php @@ -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); }