Skip to content

Commit cfd5acf

Browse files
authored
Merge pull request #541 from nextcloud/chore/remove-unused-code
chore: removed unnecessary code for old NCs
2 parents 0cfebc8 + a8de06c commit cfd5acf

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

lib/Controller/OCSSettingsController.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use OCP\AppFramework\Http\Attribute\PublicPage;
1818
use OCP\AppFramework\Http\DataResponse;
1919
use OCP\AppFramework\OCSController;
20-
use OCP\IConfig;
2120
use OCP\IRequest;
2221

2322
class OCSSettingsController extends OCSController {
@@ -26,7 +25,6 @@ class OCSSettingsController extends OCSController {
2625
public function __construct(
2726
IRequest $request,
2827
private readonly SettingsService $settingsService,
29-
private readonly IConfig $config,
3028
) {
3129
parent::__construct(Application::APP_ID, $request);
3230

@@ -37,10 +35,6 @@ public function __construct(
3735
#[PublicPage]
3836
#[AppAPIAuth]
3937
public function registerForm(array $formScheme): DataResponse {
40-
$ncVersion = $this->config->getSystemValueString('version', '0.0.0');
41-
if (version_compare($ncVersion, '29.0', '<')) {
42-
return new DataResponse([], Http::STATUS_NOT_IMPLEMENTED);
43-
}
4438
$settingsForm = $this->settingsService->registerForm(
4539
$this->request->getHeader('EX-APP-ID'), $formScheme);
4640
if ($settingsForm === null) {
@@ -53,10 +47,6 @@ public function registerForm(array $formScheme): DataResponse {
5347
#[PublicPage]
5448
#[AppAPIAuth]
5549
public function unregisterForm(string $formId): DataResponse {
56-
$ncVersion = $this->config->getSystemValueString('version', '0.0.0');
57-
if (version_compare($ncVersion, '29.0', '<')) {
58-
return new DataResponse([], Http::STATUS_NOT_IMPLEMENTED);
59-
}
6050
$unregistered = $this->settingsService->unregisterForm(
6151
$this->request->getHeader('EX-APP-ID'), $formId);
6252
if ($unregistered === null) {
@@ -69,10 +59,6 @@ public function unregisterForm(string $formId): DataResponse {
6959
#[PublicPage]
7060
#[NoCSRFRequired]
7161
public function getForm(string $formId): DataResponse {
72-
$ncVersion = $this->config->getSystemValueString('version', '0.0.0');
73-
if (version_compare($ncVersion, '29.0', '<')) {
74-
return new DataResponse([], Http::STATUS_NOT_IMPLEMENTED);
75-
}
7662
$result = $this->settingsService->getForm(
7763
$this->request->getHeader('EX-APP-ID'), $formId);
7864
if (!$result) {

lib/Controller/TaskProcessingController.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@
1818
use OCP\AppFramework\Http\DataResponse;
1919
use OCP\AppFramework\Http\Response;
2020
use OCP\AppFramework\OCSController;
21-
use OCP\IConfig;
2221
use OCP\IRequest;
2322

2423
class TaskProcessingController extends OCSController {
2524
protected $request;
2625

2726
public function __construct(
2827
IRequest $request,
29-
private readonly IConfig $config,
3028
private readonly TaskProcessingService $taskProcessingService,
3129
) {
3230
parent::__construct(Application::APP_ID, $request);
@@ -41,10 +39,6 @@ public function registerProvider(
4139
array $provider,
4240
?array $customTaskType,
4341
): DataResponse {
44-
if (!$this->isSupported()) {
45-
return new DataResponse([], Http::STATUS_NOT_IMPLEMENTED);
46-
}
47-
4842
$providerObj = $this->taskProcessingService->registerTaskProcessingProvider(
4943
$this->request->getHeader('EX-APP-ID'),
5044
$provider,
@@ -62,10 +56,6 @@ public function registerProvider(
6256
#[PublicPage]
6357
#[AppAPIAuth]
6458
public function unregisterProvider(string $name): Response {
65-
if (!$this->isSupported()) {
66-
return new DataResponse([], Http::STATUS_NOT_IMPLEMENTED);
67-
}
68-
6959
$unregistered = $this->taskProcessingService->unregisterTaskProcessingProvider(
7060
$this->request->getHeader('EX-APP-ID'), $name
7161
);
@@ -81,9 +71,6 @@ public function unregisterProvider(string $name): Response {
8171
#[PublicPage]
8272
#[AppAPIAuth]
8373
public function getProvider(string $name): DataResponse {
84-
if (!$this->isSupported()) {
85-
return new DataResponse([], Http::STATUS_NOT_IMPLEMENTED);
86-
}
8774
$result = $this->taskProcessingService->getExAppTaskProcessingProvider(
8875
$this->request->getHeader('EX-APP-ID'), $name
8976
);
@@ -92,9 +79,4 @@ public function getProvider(string $name): DataResponse {
9279
}
9380
return new DataResponse($result, Http::STATUS_OK);
9481
}
95-
96-
private function isSupported() {
97-
$ncVersion = $this->config->getSystemValueString('version', '0.0.0');
98-
return version_compare($ncVersion, '30.0', '>=');
99-
}
10082
}

lib/Service/ExAppService.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,6 @@ public function removeExAppRoutes(ExApp $exApp): ?ExApp {
441441
* @psalm-suppress UndefinedClass
442442
*/
443443
private function unregisterExAppWebhooks(string $appId): void {
444-
// webhook_listeners app since NC30 only
445-
if (version_compare($this->config->getSystemValueString('version', '0.0.0'), '30.0', '<')) {
446-
return;
447-
}
448444
try {
449445
$webhookListenerMapper = \OCP\Server::get(\OCA\WebhookListeners\Db\WebhookListenerMapper::class);
450446
$webhookListenerMapper->deleteByAppId($appId);

0 commit comments

Comments
 (0)