diff options
Diffstat (limited to 'lib/private/Contacts/ContactsMenu/Manager.php')
-rw-r--r-- | lib/private/Contacts/ContactsMenu/Manager.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Contacts/ContactsMenu/Manager.php b/lib/private/Contacts/ContactsMenu/Manager.php index 293f1366b05..d08db5775e5 100644 --- a/lib/private/Contacts/ContactsMenu/Manager.php +++ b/lib/private/Contacts/ContactsMenu/Manager.php @@ -2,6 +2,7 @@ /** * @copyright 2017 Christoph Wurst <christoph@winzerhof-wurst.at> * + * @author Arthur Schiwon <blizzz@arthur-schiwon.de> * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @author Georg Ehrke <oc.list@georgehrke.com> * @author Julius Härtl <jus@bitgrid.net> @@ -26,6 +27,7 @@ namespace OC\Contacts\ContactsMenu; use OCP\App\IAppManager; +use OCP\Constants; use OCP\Contacts\ContactsMenu\IEntry; use OCP\IConfig; use OCP\IUser; @@ -62,11 +64,11 @@ class Manager { * @return array */ public function getEntries(IUser $user, $filter) { - $maxAutocompleteResults = $this->config->getSystemValueInt('sharing.maxAutocompleteResults', 25); + $maxAutocompleteResults = max(0, $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT)); $minSearchStringLength = $this->config->getSystemValueInt('sharing.minSearchStringLength', 0); $topEntries = []; if (strlen($filter) >= $minSearchStringLength) { - $entries = $this->store->getContacts($user, $filter); + $entries = $this->store->getContacts($user, $filter, $maxAutocompleteResults); $sortedEntries = $this->sortEntries($entries); $topEntries = array_slice($sortedEntries, 0, $maxAutocompleteResults); |