From 7211869636e302a5fb0fce8c0e78d617a2593e2d Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Wed, 19 Oct 2022 20:05:58 +0200 Subject: [PATCH] Nextcloud don't search if string is less then 2 characters https://github.com/the-djmaze/snappymail/issues/561#issuecomment-1284191823 --- integrations/nextcloud/snappymail/lib/Search/Provider.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/integrations/nextcloud/snappymail/lib/Search/Provider.php b/integrations/nextcloud/snappymail/lib/Search/Provider.php index 74716fe0e..fd90abe13 100644 --- a/integrations/nextcloud/snappymail/lib/Search/Provider.php +++ b/integrations/nextcloud/snappymail/lib/Search/Provider.php @@ -55,6 +55,9 @@ class Provider implements IProvider public function search(IUser $user, ISearchQuery $query): SearchResult { $result = []; + if (1 < \strlen(\trim($query->getTerm()))) { + return SearchResult::complete($this->getName(), $result); + } SnappyMailHelper::startApp(); $oActions = \RainLoop\Api::Actions(); // $oAccount = $oActions->getMainAccountFromToken(false); // Issue: when account switched, wrong email is shown