Skip to content

Commit

Permalink
do not wait for nextcloud/server#22085
Browse files Browse the repository at this point in the history
Signed-off-by: call-me-matt <nextcloud@matthiasheinisch.de>
  • Loading branch information
call-me-matt committed Sep 5, 2020
1 parent 81b3885 commit 33a53fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Service/SocialApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,16 @@ public function updateAddressbooks(string $network, string $userId, string $offs
}

// 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]);
usort($contacts, [$this, 'sortContacts']); // make sure the order stays the same in consecutive calls

// update one contact after another
Expand Down

0 comments on commit 33a53fc

Please sign in to comment.