diff --git a/apps/files_sharing/lib/Controller/RemoteController.php b/apps/files_sharing/lib/Controller/RemoteController.php index b507bf6a04a0c..8c8b243112c63 100644 --- a/apps/files_sharing/lib/Controller/RemoteController.php +++ b/apps/files_sharing/lib/Controller/RemoteController.php @@ -66,7 +66,10 @@ public function __construct( * 200: Pending remote shares returned */ public function getOpenShares() { - return new DataResponse($this->externalManager->getOpenShares()); + // WIP: Changes seem unhelpful since, $info = $view->getFileInfo($share['mountpoint']); + // WIP: in self::extendShareInfo returns false + $openShares = $this->externalManager->getOpenShares(); + return new DataResponse(array_map('self::extendShareInfo', $openShares)); } /** diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index f18d8346dc44d..e33b95ac0b682 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -812,6 +812,15 @@ private function getShares($accepted) { if ((int)$share['share_type'] === IShare::TYPE_GROUP && (int)$share['parent'] > 0) { $toRemove[] = $share['parent']; } + + // Create share object and attempt to get and sent node data? + $shareObject = new Share($this->rootFolder, $this->userManager); + $shareObject->setId((int)$share['id']) + ->setShareType((int)$share['share_type']) + ->setPermissions((int)$share['permissions']) + ->setTarget($share['file_target']) // Not available, should break this + ->setMailSend((bool)$share['mail_send']) + ->setToken($share['share_token']); } $shares = array_filter($shares, function ($share) use ($toRemove) { return !in_array($share['id'], $toRemove, true); diff --git a/apps/files_sharing/src/services/SharingService.ts b/apps/files_sharing/src/services/SharingService.ts index 41861c5d3ea53..90bee2ccc362b 100644 --- a/apps/files_sharing/src/services/SharingService.ts +++ b/apps/files_sharing/src/services/SharingService.ts @@ -42,7 +42,9 @@ const ocsEntryToNode = function(ocsEntry: any): Folder | File | null { const hasPreview = ocsEntry?.has_preview === true const Node = isFolder ? Folder : File - const fileid = ocsEntry.file_source + const fileid = ocsEntry.file_source ?? ocsEntry.file_id + console.log('Entry', ocsEntry) // WIP stuff + // Generate path and strip double slashes const path = ocsEntry?.path || ocsEntry.file_target @@ -58,7 +60,7 @@ const ocsEntryToNode = function(ocsEntry: any): Folder | File | null { id: fileid, source, owner: ocsEntry?.uid_owner, - mime: ocsEntry?.mimetype, + mime: ocsEntry?.mimetype ?? 'application/octet-stream', mtime, size: ocsEntry?.item_size, permissions: ocsEntry?.item_permissions || ocsEntry?.permissions,