Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Contacts/ContactsMenu/ContactsStore.php')
-rw-r--r--lib/private/Contacts/ContactsMenu/ContactsStore.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php
index b6e401cbe71..267cc5519e3 100644
--- a/lib/private/Contacts/ContactsMenu/ContactsStore.php
+++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php
@@ -71,11 +71,23 @@ class ContactsStore implements IContactsStore {
* @param string|null $filter
* @return IEntry[]
*/
- public function getContacts(IUser $user, $filter) {
- $allContacts = $this->contactsManager->search($filter ?: '', [
- 'FN',
- 'EMAIL'
- ]);
+ public function getContacts(IUser $user, $filter, ?int $limit = null, ?int $offset = null) {
+ $options = [];
+ if ($limit !== null) {
+ $options['limit'] = $limit;
+ }
+ if ($offset !== null) {
+ $options['offset'] = $offset;
+ }
+
+ $allContacts = $this->contactsManager->search(
+ $filter ?: '',
+ [
+ 'FN',
+ 'EMAIL'
+ ],
+ $options
+ );
$entries = array_map(function(array $contact) {
return $this->contactArrayToEntry($contact);
@@ -119,7 +131,7 @@ class ContactsStore implements IContactsStore {
if ($excludedGroups) {
$excludedGroups = $this->config->getAppValue('core', 'shareapi_exclude_groups_list', '');
$decodedExcludeGroups = json_decode($excludedGroups, true);
- $excludeGroupsList = ($decodedExcludeGroups !== null) ? $decodedExcludeGroups : [];
+ $excludeGroupsList = ($decodedExcludeGroups !== null) ? $decodedExcludeGroups : [];
if (count(array_intersect($excludeGroupsList, $selfGroups)) !== 0) {
// a group of the current user is excluded -> filter all local users