diff options
Diffstat (limited to 'apps/dav/lib/CardDAV/UserAddressBooks.php')
-rw-r--r-- | apps/dav/lib/CardDAV/UserAddressBooks.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/dav/lib/CardDAV/UserAddressBooks.php b/apps/dav/lib/CardDAV/UserAddressBooks.php index 6a0394676a1..d1fcbf2ce13 100644 --- a/apps/dav/lib/CardDAV/UserAddressBooks.php +++ b/apps/dav/lib/CardDAV/UserAddressBooks.php @@ -22,6 +22,7 @@ */ namespace OCA\DAV\CardDAV; +use OCP\IConfig; use OCP\IL10N; class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome { @@ -29,6 +30,9 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome { /** @var IL10N */ protected $l10n; + /** @var IConfig */ + protected $config; + /** * Returns a list of addressbooks * @@ -38,11 +42,18 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome { if ($this->l10n === null) { $this->l10n = \OC::$server->getL10N('dav'); } + if ($this->config === null) { + $this->config = \OC::$server->getConfig(); + } $addressBooks = $this->carddavBackend->getAddressBooksForUser($this->principalUri); $objects = []; foreach($addressBooks as $addressBook) { - $objects[] = new AddressBook($this->carddavBackend, $addressBook, $this->l10n); + if ($addressBook['principaluri'] === 'principals/system/system') { + $objects[] = new SystemAddressbook($this->carddavBackend, $addressBook, $this->l10n, $this->config); + } else { + $objects[] = new AddressBook($this->carddavBackend, $addressBook, $this->l10n); + } } return $objects; |