mirror of
https://github.com/nextcloud/server.git
synced 2026-04-20 22:00:39 -04:00
Improve email search results
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
256fbe9d77
commit
269df904a3
1 changed files with 6 additions and 0 deletions
|
|
@ -101,6 +101,12 @@ class MailPlugin implements ISearchPlugin {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Extract the email address from "Foo Bar <foo.bar@example.tld>" and then search with "foo.bar@example.tld" instead
|
||||
$result = preg_match('/<([^@]+@.+)>$/', $search, $matches);
|
||||
if ($result && filter_var($matches[1], FILTER_VALIDATE_EMAIL)) {
|
||||
return $this->search($matches[1], $limit, $offset, $searchResult);
|
||||
}
|
||||
|
||||
$currentUserId = $this->userSession->getUser()->getUID();
|
||||
|
||||
$result = $userResults = ['wide' => [], 'exact' => []];
|
||||
|
|
|
|||
Loading…
Reference in a new issue