diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-05-11 23:38:23 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-05-11 23:38:31 +0200 |
commit | 665ffbdf80dbb07af607c3470c52f9bf5c93ad2b (patch) | |
tree | 12ac92ece2e61964496e499a7965fc36c537311f /apps/dav/lib/CardDAV | |
parent | 04edd067f4382f5d3824929f3f21b415e115155a (diff) | |
download | nextcloud-server-665ffbdf80dbb07af607c3470c52f9bf5c93ad2b.tar.gz nextcloud-server-665ffbdf80dbb07af607c3470c52f9bf5c93ad2b.zip |
remove private AccountManager from SyncService
and fix test
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/dav/lib/CardDAV')
-rw-r--r-- | apps/dav/lib/CardDAV/SyncService.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php index bcb20409524..2cbdba2b119 100644 --- a/apps/dav/lib/CardDAV/SyncService.php +++ b/apps/dav/lib/CardDAV/SyncService.php @@ -54,8 +54,8 @@ class SyncService { /** @var array */ private $localSystemAddressBook; - /** @var AccountManager */ - private $accountManager; + /** @var Converter */ + private $converter; /** @var string */ protected $certPath; @@ -68,11 +68,11 @@ class SyncService { * @param ILogger $logger * @param AccountManager $accountManager */ - public function __construct(CardDavBackend $backend, IUserManager $userManager, ILogger $logger, AccountManager $accountManager) { + public function __construct(CardDavBackend $backend, IUserManager $userManager, ILogger $logger, Converter $converter) { $this->backend = $backend; $this->userManager = $userManager; $this->logger = $logger; - $this->accountManager = $accountManager; + $this->converter = $converter; $this->certPath = ''; } @@ -265,7 +265,6 @@ class SyncService { public function updateUser(IUser $user) { $systemAddressBook = $this->getLocalSystemAddressBook(); $addressBookId = $systemAddressBook['id']; - $converter = new Converter($this->accountManager); $name = $user->getBackendClassName(); $userId = $user->getUID(); @@ -273,12 +272,12 @@ class SyncService { $card = $this->backend->getCard($addressBookId, $cardId); if ($user->isEnabled()) { if ($card === false) { - $vCard = $converter->createCardFromUser($user); + $vCard = $this->converter->createCardFromUser($user); if ($vCard !== null) { $this->backend->createCard($addressBookId, $cardId, $vCard->serialize()); } } else { - $vCard = $converter->createCardFromUser($user); + $vCard = $this->converter->createCardFromUser($user); if (is_null($vCard)) { $this->backend->deleteCard($addressBookId, $cardId); } else { |