diff --git a/lib/AppInfo/Capabilities.php b/lib/AppInfo/Capabilities.php index c08327657..84a5570d1 100644 --- a/lib/AppInfo/Capabilities.php +++ b/lib/AppInfo/Capabilities.php @@ -9,16 +9,14 @@ namespace OCA\Notes\AppInfo; -use OCA\Notes\Service\NoteUtil; use OCP\App\IAppManager; use OCP\Capabilities\ICapability; class Capabilities implements ICapability { - public function __construct( - private IAppManager $appManager, - private NoteUtil $noteUtil, - private ?string $userId, - ) { + private IAppManager $appManager; + + public function __construct(IAppManager $appManager) { + $this->appManager = $appManager; } public function getCapabilities(): array { @@ -26,7 +24,6 @@ public function getCapabilities(): array { Application::APP_ID => [ 'api_version' => Application::$API_VERSIONS, 'version' => $this->appManager->getAppVersion(Application::APP_ID), - 'notes_path' => $this->userId !== null && $this->userId !== ' ' ? $this->noteUtil->getNotesFolderUserPath($this->userId) : null, ], ]; } diff --git a/lib/Service/NoteUtil.php b/lib/Service/NoteUtil.php index 6cb52711b..a99ea5c03 100644 --- a/lib/Service/NoteUtil.php +++ b/lib/Service/NoteUtil.php @@ -183,13 +183,6 @@ public function getOrCreateFolder(string $path, bool $create = true) : Folder { return $folder; } - public function getNotesFolderUserPath(string $userId): ?string { - /** @psalm-suppress MissingDependency */ - $userFolder = $this->getRoot()->getUserFolder($userId); - $nodesFolder = $this->getOrCreateNotesFolder($userId, false); - return $userFolder->getRelativePath($nodesFolder->getPath()); - } - public function getOrCreateNotesFolder(string $userId, bool $create = true) : Folder { $userFolder = $this->getRoot()->getUserFolder($userId); $notesPath = $this->settingsService->get($userId, 'notesPath');