From b95f00f9d020536fc66a46dab65650cce5101668 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Mon, 9 Dec 2019 21:03:07 +0100 Subject: [PATCH] Use IProviderManager to register resource provider Signed-off-by: Daniel Kesselberg --- lib/AppInfo/Application.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 7348242f7..31511c099 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -183,10 +183,18 @@ class Application extends App { /** * Register Collaboration ResourceProvider + * + * @Todo: Remove if min-version is 18 */ - /** @var IManager $resourceManager */ - $resourceManager = $this->getContainer()->query(IManager::class); + if ($version < 18) { + /** @var IManager $resourceManager */ + $resourceManager = $this->getContainer()->query(IManager::class); + } else { + /** @var \OCP\Collaboration\Resources\IProviderManager $resourceManager */ + $resourceManager = $this->getContainer()->query(\OCP\Collaboration\Resources\IProviderManager::class); + } $resourceManager->registerResourceProvider(\OCA\Deck\Collaboration\Resources\ResourceProvider::class); + \OC::$server->getEventDispatcher()->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function () { \OCP\Util::addScript('deck', 'build/collections'); });