2016-10-21 05:45:17 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2016-10-21 05:45:17 -04:00
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud GmbH
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2016-10-21 05:45:17 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\DAV;
|
|
|
|
|
|
|
|
|
|
use OCP\Capabilities\ICapability;
|
2022-08-25 08:47:25 -04:00
|
|
|
use OCP\IConfig;
|
2024-12-01 16:22:38 -05:00
|
|
|
use OCP\User\IAvailabilityCoordinator;
|
2016-10-21 05:45:17 -04:00
|
|
|
|
|
|
|
|
class Capabilities implements ICapability {
|
2024-10-18 06:04:22 -04:00
|
|
|
public function __construct(
|
|
|
|
|
private IConfig $config,
|
2024-12-01 16:22:38 -05:00
|
|
|
private IAvailabilityCoordinator $coordinator,
|
2024-10-18 06:04:22 -04:00
|
|
|
) {
|
2022-08-25 08:47:25 -04:00
|
|
|
}
|
|
|
|
|
|
2023-03-20 13:46:52 -04:00
|
|
|
/**
|
2025-04-14 09:41:13 -04:00
|
|
|
* @return array{dav: array{chunking: string, public_shares_chunking: bool, bulkupload?: string, absence-supported?: bool, absence-replacement?: bool}}
|
2023-03-20 13:46:52 -04:00
|
|
|
*/
|
2016-10-21 05:45:17 -04:00
|
|
|
public function getCapabilities() {
|
2022-08-25 08:47:25 -04:00
|
|
|
$capabilities = [
|
2016-10-21 05:45:17 -04:00
|
|
|
'dav' => [
|
|
|
|
|
'chunking' => '1.0',
|
2025-11-18 03:51:19 -05:00
|
|
|
'public_shares_chunking' => true,
|
2016-10-21 05:45:17 -04:00
|
|
|
]
|
|
|
|
|
];
|
2025-04-11 17:39:25 -04:00
|
|
|
if ($this->config->getSystemValueBool('bulkupload.enabled', true)) {
|
2022-08-25 08:47:25 -04:00
|
|
|
$capabilities['dav']['bulkupload'] = '1.0';
|
|
|
|
|
}
|
2024-12-01 16:22:38 -05:00
|
|
|
if ($this->coordinator->isEnabled()) {
|
|
|
|
|
$capabilities['dav']['absence-supported'] = true;
|
2024-12-01 16:23:51 -05:00
|
|
|
$capabilities['dav']['absence-replacement'] = true;
|
2024-12-01 16:22:38 -05:00
|
|
|
}
|
2022-08-25 08:47:25 -04:00
|
|
|
return $capabilities;
|
2016-10-21 05:45:17 -04:00
|
|
|
}
|
|
|
|
|
}
|