From 61472fc09829499c680e93c3f7f537f4f3a9e6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 12 Mar 2024 09:45:44 +0100 Subject: [PATCH] chore: Remove legacy reference provider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/AppInfo/Application.php | 19 +------ lib/Reference/LegacyReferenceProvider.php | 67 ----------------------- 2 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 lib/Reference/LegacyReferenceProvider.php diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 738534a66..304eb1682 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -9,8 +9,6 @@ use OCA\Tables\Listener\LoadAdditionalListener; use OCA\Tables\Listener\TablesReferenceListener; use OCA\Tables\Listener\UserDeletedListener; -use OCA\Tables\Reference\ContentReferenceProvider; -use OCA\Tables\Reference\LegacyReferenceProvider; use OCA\Tables\Reference\ReferenceProvider; use OCA\Tables\Search\SearchTablesProvider; use OCP\AppFramework\App; @@ -19,12 +17,7 @@ use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\Collaboration\Reference\RenderReferenceEvent; use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent; -use OCP\IConfig; -use OCP\Server; use OCP\User\Events\BeforeUserDeletedEvent; -use Psr\Container\ContainerExceptionInterface; - -use Psr\Container\NotFoundExceptionInterface; class Application extends App implements IBootstrap { public const APP_ID = 'tables'; @@ -52,17 +45,7 @@ public function register(IRegistrationContext $context): void { $context->registerSearchProvider(SearchTablesProvider::class); - try { - /** @var IConfig $config */ - $config = Server::get(IConfig::class); - if (version_compare($config->getSystemValueString('version', '0.0.0'), '26.0.0', '<')) { - $context->registerReferenceProvider(LegacyReferenceProvider::class); - } else { - $context->registerReferenceProvider(ReferenceProvider::class); - } - $context->registerReferenceProvider(ContentReferenceProvider::class); - } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { - } + $context->registerReferenceProvider(ReferenceProvider::class); $context->registerCapability(Capabilities::class); } diff --git a/lib/Reference/LegacyReferenceProvider.php b/lib/Reference/LegacyReferenceProvider.php deleted file mode 100644 index 86088eba3..000000000 --- a/lib/Reference/LegacyReferenceProvider.php +++ /dev/null @@ -1,67 +0,0 @@ -referenceHelper = $referenceHelper; - $this->referenceManager = $referenceManager; - $this->urlGenerator = $urlGenerator; - $this->l10n = $l10n; - } - - /** - * @inheritDoc - */ - public function matchReference(string $referenceText): bool { - return $this->referenceHelper->matchReference($referenceText); - } - - /** - * @inheritDoc - */ - public function resolveReference(string $referenceText): ?IReference { - return $this->referenceHelper->resolveReference($referenceText); - } - - /** - * @param string $url - * @return int|null - */ - public function getTableIdFromLink(string $url): ?int { - return $this->referenceHelper->getTableIdFromLink($url); - } - - /** - * @inheritDoc - */ - public function getCachePrefix(string $referenceId): string { - return $this->referenceHelper->getCachePrefix($referenceId); - } - - /** - * @inheritDoc - */ - public function getCacheKey(string $referenceId): ?string { - return $this->referenceHelper->getCacheKey($referenceId); - } - - /** - * @param string $userId - * @return void - */ - public function invalidateUserCache(string $userId): void { - $this->referenceManager->invalidateCache($userId); - } -}