Revert "Fix sync errors for duplicate cards with the same UID for different backends"

This reverts commit ddcee3dbab.

Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
Christopher Ng 2023-01-13 02:11:09 +00:00
parent bec52be8ed
commit e6f4705920
2 changed files with 2 additions and 4 deletions

View file

@ -47,14 +47,12 @@ class Converter {
$userProperties = $this->accountManager->getAccount($user)->getProperties();
$uid = $user->getUID();
$backendClassName = $user->getBackendClassName();
$cloudId = $user->getCloudId();
$image = $this->getAvatarImage($user);
$vCard = new VCard();
$vCard->VERSION = '3.0';
$vCard->UID = md5("$backendClassName:$uid");
$vCard->add(new Text($vCard, 'X-NEXTCLOUD-UID', $uid));
$vCard->UID = $uid;
$publish = false;

View file

@ -274,7 +274,7 @@ class SyncService {
$allCards = $this->backend->getCards($systemAddressBook['id']);
foreach ($allCards as $card) {
$vCard = Reader::read($card['carddata']);
$uid = isset($vCard->{'X-NEXTCLOUD-UID'}) ? $vCard->{'X-NEXTCLOUD-UID'}->getValue() : $vCard->UID->getValue();
$uid = $vCard->UID->getValue();
// load backend and see if user exists
if (!$this->userManager->userExists($uid)) {
$this->deleteUser($card['uri']);