diff options
Diffstat (limited to 'lib/DAV/WorkspacePlugin.php')
-rw-r--r-- | lib/DAV/WorkspacePlugin.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/DAV/WorkspacePlugin.php b/lib/DAV/WorkspacePlugin.php index a7c7e896b..764aa1f36 100644 --- a/lib/DAV/WorkspacePlugin.php +++ b/lib/DAV/WorkspacePlugin.php @@ -41,6 +41,7 @@ use Sabre\DAV\ServerPlugin; class WorkspacePlugin extends ServerPlugin { public const WORKSPACE_PROPERTY = '{http://nextcloud.org/ns}rich-workspace'; + public const WORKSPACE_FILE_PROPERTY = '{http://nextcloud.org/ns}rich-workspace-file'; /** @var Server */ private $server; @@ -112,6 +113,22 @@ class WorkspacePlugin extends ServerPlugin { } return ''; }); + $propFind->handle(self::WORKSPACE_FILE_PROPERTY, function () use ($node) { + /** @var Folder[] $nodes */ + $nodes = $this->rootFolder->getUserFolder($this->userId)->getById($node->getId()); + if (count($nodes) > 0) { + /** @var File $file */ + try { + $file = $this->workspaceService->getFile($nodes[0]); + if ($file instanceof File) { + return $file->getFileInfo()->getName(); + } + } catch (StorageNotAvailableException $e) { + // If a storage is not available we can for the propfind response assume that there is no rich workspace present + } + } + return ''; + }); } } } |