diff options
Diffstat (limited to 'apps/dav/lib/CardDAV/SyncService.php')
-rw-r--r-- | apps/dav/lib/CardDAV/SyncService.php | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php index ee68a4a26ec..5bd92015ad7 100644 --- a/apps/dav/lib/CardDAV/SyncService.php +++ b/apps/dav/lib/CardDAV/SyncService.php @@ -270,18 +270,22 @@ class SyncService { $cardId = "$name:$userId.vcf"; $card = $this->backend->getCard($addressBookId, $cardId); - if ($card === false) { - $vCard = $converter->createCardFromUser($user); - if ($vCard !== null) { - $this->backend->createCard($addressBookId, $cardId, $vCard->serialize()); - } - } else { - $vCard = $converter->createCardFromUser($user); - if (is_null($vCard)) { - $this->backend->deleteCard($addressBookId, $cardId); + if ($user->isEnabled()) { + if ($card === false) { + $vCard = $converter->createCardFromUser($user); + if ($vCard !== null) { + $this->backend->createCard($addressBookId, $cardId, $vCard->serialize()); + } } else { - $this->backend->updateCard($addressBookId, $cardId, $vCard->serialize()); + $vCard = $converter->createCardFromUser($user); + if (is_null($vCard)) { + $this->backend->deleteCard($addressBookId, $cardId); + } else { + $this->backend->updateCard($addressBookId, $cardId, $vCard->serialize()); + } } + } else { + $this->backend->deleteCard($addressBookId, $cardId); } } |