diff --git a/appinfo/app.php b/appinfo/app.php index c36e43df..775f6ab8 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -64,7 +64,7 @@ if (\OCP\User::isLoggedIn()) { $addressBooks = $app->getAddressBooksForUser(); foreach ($addressBooks as $addressBook) { if ($addressBook->isActive()) { - \OCP\Contacts::registerAddressBook(new AddressbookProvider($addressBook)); + \OCP\Contacts::registerAddressBook($addressBook->getSearchProvider()); } } } diff --git a/lib/addressbook.php b/lib/addressbook.php index 0a9cc23a..c4984839 100644 --- a/lib/addressbook.php +++ b/lib/addressbook.php @@ -482,4 +482,12 @@ class Addressbook extends AbstractPIMCollection { return $events; } + + /** + * Returns the searchProvider for a specific backend. + * @param \OCA\Contacts\Addressbook $addressbook + */ + public function getSearchProvider(){ + return $this->backend->getSearchProvider($this); + } }