From b79788e6111a674eb5cfc8d068b07c6b4f7853ae Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 24 Jan 2025 14:29:52 +0100 Subject: [PATCH] add notes path to capabilities --- lib/AppInfo/Capabilities.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/AppInfo/Capabilities.php b/lib/AppInfo/Capabilities.php index 84a5570d1..113938e87 100644 --- a/lib/AppInfo/Capabilities.php +++ b/lib/AppInfo/Capabilities.php @@ -9,14 +9,15 @@ namespace OCA\Notes\AppInfo; +use OCA\Notes\Service\NoteUtil; use OCP\App\IAppManager; use OCP\Capabilities\ICapability; +use OCP\IUserSession; class Capabilities implements ICapability { - private IAppManager $appManager; - - public function __construct(IAppManager $appManager) { - $this->appManager = $appManager; + public function __construct(private IAppManager $appManager, + private NoteUtil $noteUtil, + private IUserSession $userSession) { } public function getCapabilities(): array { @@ -24,6 +25,7 @@ public function getCapabilities(): array { Application::APP_ID => [ 'api_version' => Application::$API_VERSIONS, 'version' => $this->appManager->getAppVersion(Application::APP_ID), + 'notes_path' => $this->noteUtil->getOrCreateNotesFolder($this->userSession->getUser()->getUID())->getInternalPath() ], ]; }