Skip to content

Commit

Permalink
fix: Proper fallback for app config methods on Nextcloud 28
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <[email protected]>
  • Loading branch information
juliusknorr committed Oct 8, 2024
1 parent e5c8ac8 commit 0486077
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}
}

0 comments on commit 0486077

Please sign in to comment.