diff options
author | Julien Veyssier <julien-nc@posteo.net> | 2023-01-12 15:47:20 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2023-01-27 11:10:56 +0100 |
commit | 946a1af9fd20d12a2ee6240ad2ae24827a22278c (patch) | |
tree | d7add9a58d1d7830d3c6948c167b32902a52b5ec /core/Controller | |
parent | 6431c5a559a1361ae9148adf22b21630b8a37431 (diff) | |
download | nextcloud-server-946a1af9fd20d12a2ee6240ad2ae24827a22278c.tar.gz nextcloud-server-946a1af9fd20d12a2ee6240ad2ae24827a22278c.zip |
add 'last used timestamp' management for reference providers
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/ReferenceApiController.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/core/Controller/ReferenceApiController.php b/core/Controller/ReferenceApiController.php index 098940187a8..9c3a212e8d7 100644 --- a/core/Controller/ReferenceApiController.php +++ b/core/Controller/ReferenceApiController.php @@ -31,10 +31,15 @@ use OCP\IRequest; class ReferenceApiController extends \OCP\AppFramework\OCSController { private IReferenceManager $referenceManager; + private ?string $userId; - public function __construct(string $appName, IRequest $request, IReferenceManager $referenceManager) { + public function __construct(string $appName, + IRequest $request, + IReferenceManager $referenceManager, + ?string $userId) { parent::__construct($appName, $request); $this->referenceManager = $referenceManager; + $this->userId = $userId; } /** @@ -102,4 +107,17 @@ class ReferenceApiController extends \OCP\AppFramework\OCSController { }, $providers); return new DataResponse($jsonProviders); } + + /** + * @NoAdminRequired + * + * @param string $providerId + * @return DataResponse + */ + public function touchProvider(string $providerId, ?int $timestamp = null): DataResponse { + if ($this->userId !== null) { + $this->referenceManager->touchProvider($this->userId, $providerId, $timestamp); + } + return new DataResponse(['success' => true]); + } } |