From ec245d5feccc63abae3944c2ed59c99fbad3e6d7 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 27 Feb 2020 16:54:07 +0100 Subject: Add address book plugins Signed-off-by: Christoph Wurst --- apps/dav/lib/CardDAV/AddressBookRoot.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'apps/dav/lib/CardDAV/AddressBookRoot.php') diff --git a/apps/dav/lib/CardDAV/AddressBookRoot.php b/apps/dav/lib/CardDAV/AddressBookRoot.php index 4b836616791..4436775653d 100644 --- a/apps/dav/lib/CardDAV/AddressBookRoot.php +++ b/apps/dav/lib/CardDAV/AddressBookRoot.php @@ -24,21 +24,24 @@ namespace OCA\DAV\CardDAV; -use OCP\IL10N; +use OCA\DAV\AppInfo\PluginManager; class AddressBookRoot extends \Sabre\CardDAV\AddressBookRoot { - /** @var IL10N */ - protected $l10n; + /** @var PluginManager */ + private $pluginManager; /** * @param \Sabre\DAVACL\PrincipalBackend\BackendInterface $principalBackend * @param \Sabre\CardDAV\Backend\BackendInterface $carddavBackend * @param string $principalPrefix */ - public function __construct(\Sabre\DAVACL\PrincipalBackend\BackendInterface $principalBackend, \Sabre\CardDAV\Backend\BackendInterface $carddavBackend, $principalPrefix = 'principals') { + public function __construct(\Sabre\DAVACL\PrincipalBackend\BackendInterface $principalBackend, + \Sabre\CardDAV\Backend\BackendInterface $carddavBackend, + PluginManager $pluginManager, + $principalPrefix = 'principals') { parent::__construct($principalBackend, $carddavBackend, $principalPrefix); - $this->l10n = \OC::$server->getL10N('dav'); + $this->pluginManager = $pluginManager; } /** @@ -49,12 +52,11 @@ class AddressBookRoot extends \Sabre\CardDAV\AddressBookRoot { * supplied by the authentication backend. * * @param array $principal + * * @return \Sabre\DAV\INode */ function getChildForPrincipal(array $principal) { - - return new UserAddressBooks($this->carddavBackend, $principal['uri'], $this->l10n); - + return new UserAddressBooks($this->carddavBackend, $principal['uri'], $this->pluginManager); } function getName() { -- cgit v1.2.3