diff options
author | call-me-matt <nextcloud@matthiasheinisch.de> | 2022-05-04 14:02:00 +0300 |
---|---|---|
committer | call-me-matt <nextcloud@matthiasheinisch.de> | 2022-05-04 14:15:08 +0300 |
commit | 991cc65f0f3e1cb446362b5b48224409779b35dc (patch) | |
tree | 88e7b395ecaf22a7b6f401b71ba0e2c17bcd4d7c /lib/Service | |
parent | a84d7fa7ce66839a0e44934faf652e8c3a69fc23 (diff) |
optimize search for contacts with social data
Signed-off-by: call-me-matt <nextcloud@matthiasheinisch.de>
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/SocialApiService.php | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/Service/SocialApiService.php b/lib/Service/SocialApiService.php index b7a4d3a8..e1c85cf4 100644 --- a/lib/Service/SocialApiService.php +++ b/lib/Service/SocialApiService.php @@ -38,7 +38,6 @@ use OCP\IAddressBook; use OCP\IConfig; use OCP\IL10N; use OCP\IURLGenerator; -use OCP\Util; class SocialApiService { private $appName; @@ -368,8 +367,6 @@ class SocialApiService { foreach ($addressBooks as $addressBook) { if ((is_null($addressBook) || - (Util::getVersion()[0] >= 20) && - //TODO: remove version check ^ when dependency for contacts is min NCv20 (see info.xml) ($addressBook->isShared() || $addressBook->isSystemAddressBook()))) { // TODO: filter out deactivated books, see https://github.com/nextcloud/server/issues/17537 continue; @@ -384,16 +381,7 @@ class SocialApiService { } // get contacts in that addressbook - //TODO: activate this optimization when nextcloud/server#22085 is merged - /* - if (Util::getVersion()[0] < 21) { - //TODO: remove this branch when dependency for contacts is min NCv21 (see info.xml) - $contacts = $addressBook->search('', ['UID'], ['types' => true]); - } else { - $contacts = $addressBook->search('', ['X-SOCIALPROFILE'], ['types' => true]); - } - */ - $contacts = $addressBook->search('', ['UID'], ['types' => true]); + $contacts = $addressBook->search('', ['X-SOCIALPROFILE'], ['types' => true]); usort($contacts, [$this, 'sortContacts']); // make sure the order stays the same in consecutive calls // update one contact after another |