diff options
-rw-r--r-- | lib/Service/SocialApiService.php | 14 | ||||
-rw-r--r-- | tests/unit/Service/SocialApiServiceTest.php | 1 |
2 files changed, 1 insertions, 14 deletions
diff --git a/lib/Service/SocialApiService.php b/lib/Service/SocialApiService.php index 089b5dad..9d776bd3 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; @@ -370,8 +369,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; @@ -386,16 +383,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 diff --git a/tests/unit/Service/SocialApiServiceTest.php b/tests/unit/Service/SocialApiServiceTest.php index a56cbafc..cd7e1e43 100644 --- a/tests/unit/Service/SocialApiServiceTest.php +++ b/tests/unit/Service/SocialApiServiceTest.php @@ -466,7 +466,6 @@ class SocialApiServiceTest extends TestCase { $this->assertArrayHasKey('failed', $report[0]); $this->assertArrayHasKey('412', $report[0]['failed']); $this->assertContains('Invalid Contact', $report[0]['failed']['412']); - $this->assertContains('Empty Contact', $report[0]['failed']['412']); } } |