From 0486077043c243004e6bf6d1374130b4fb00ec8f Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Tue, 8 Oct 2024 18:55:00 +0200 Subject: [PATCH] fix: Proper fallback for app config methods on Nextcloud 28 Signed-off-by: Julius Knorr --- lib/Service/ConfigService.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index 09e852b..1e46d0c 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -18,14 +18,27 @@ public function __construct( } public function getJwtSecretKey(): string { + if (!method_exists($this->appConfig, 'getAppValueString')) { + return $this->appConfig->getAppValue('jwt_secret_key'); + } + return $this->appConfig->getAppValueString('jwt_secret_key'); } public function getCollabBackendUrl(): string { + if (!method_exists($this->appConfig, 'getAppValueString')) { + return $this->appConfig->getAppValue('collabBackendUrl'); + } + return $this->appConfig->getAppValueString('collabBackendUrl'); } public function setCollabBackendUrl(string $collabBackendUrl): void { + if (!method_exists($this->appConfig, 'setAppValueString')) { + $this->appConfig->setAppValue('collabBackendUrl', $collabBackendUrl); + return; + } + $this->appConfig->setAppValueString('collabBackendUrl', $collabBackendUrl); } @@ -34,6 +47,11 @@ public function getWhiteboardSharedSecret(): string { } public function setWhiteboardSharedSecret(string $jwtSecretKey): void { + if (!method_exists($this->appConfig, 'setAppValueString')) { + $this->appConfig->setAppValue('jwt_secret_key', $jwtSecretKey); + return; + } + $this->appConfig->setAppValueString('jwt_secret_key', $jwtSecretKey); } }