mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: Include email when searching share suggestions
Signed-off-by: nfebe <fenn25.fn@gmail.com> [skip ci]
This commit is contained in:
parent
75179f9520
commit
26c452c6ee
1 changed files with 12 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ class RemotePlugin implements ISearchPlugin {
|
|||
$resultType = new SearchResultType('remotes');
|
||||
|
||||
// Search in contacts
|
||||
$addressBookContacts = $this->contactsManager->search($search, ['CLOUD', 'FN'], [
|
||||
$addressBookContacts = $this->contactsManager->search($search, ['CLOUD', 'FN', 'EMAIL'], [
|
||||
'limit' => $limit,
|
||||
'offset' => $offset,
|
||||
'enumeration' => false,
|
||||
|
|
@ -83,7 +83,17 @@ class RemotePlugin implements ISearchPlugin {
|
|||
];
|
||||
}
|
||||
|
||||
if (strtolower($contact['FN']) === $lowerSearch || strtolower($cloudId) === $lowerSearch) {
|
||||
$emailMatch = false;
|
||||
if (isset($contact['EMAIL'])) {
|
||||
$emails = is_array($contact['EMAIL']) ? $contact['EMAIL'] : [$contact['EMAIL']];
|
||||
foreach ($emails as $email) {
|
||||
if (is_string($email) && strtolower($email) === $lowerSearch) {
|
||||
$emailMatch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($emailMatch || strtolower($contact['FN']) === $lowerSearch || strtolower($cloudId) === $lowerSearch) {
|
||||
if (strtolower($cloudId) === $lowerSearch) {
|
||||
$searchResult->markExactIdMatch($resultType);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue