summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Controller/DeletedShareAPIController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/Controller/DeletedShareAPIController.php')
-rw-r--r--apps/files_sharing/lib/Controller/DeletedShareAPIController.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Controller/DeletedShareAPIController.php b/apps/files_sharing/lib/Controller/DeletedShareAPIController.php
index 9b367e06544..1981c0c1945 100644
--- a/apps/files_sharing/lib/Controller/DeletedShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/DeletedShareAPIController.php
@@ -151,6 +151,14 @@ class DeletedShareAPIController extends OCSController {
$result = array_merge($result, $this->getRoomShareHelper()->formatShare($share));
} catch (QueryException $e) {
}
+ } elseif ($share->getShareType() === IShare::TYPE_DECK) {
+ $result['share_with'] = $share->getSharedWith();
+ $result['share_with_displayname'] = '';
+
+ try {
+ $result = array_merge($result, $this->getDeckShareHelper()->formatShare($share));
+ } catch (QueryException $e) {
+ }
}
return $result;
@@ -162,8 +170,9 @@ class DeletedShareAPIController extends OCSController {
public function index(): DataResponse {
$groupShares = $this->shareManager->getDeletedSharedWith($this->userId, IShare::TYPE_GROUP, null, -1, 0);
$roomShares = $this->shareManager->getDeletedSharedWith($this->userId, IShare::TYPE_ROOM, null, -1, 0);
+ $deckShares = $this->shareManager->getDeletedSharedWith($this->userId, IShare::TYPE_DECK, null, -1, 0);
- $shares = array_merge($groupShares, $roomShares);
+ $shares = array_merge($groupShares, $roomShares, $deckShares);
$shares = array_map(function (IShare $share) {
return $this->formatShare($share);
@@ -213,4 +222,21 @@ class DeletedShareAPIController extends OCSController {
return $this->serverContainer->query('\OCA\Talk\Share\Helper\DeletedShareAPIController');
}
+
+ /**
+ * Returns the helper of ShareAPIHelper for deck shares.
+ *
+ * If the Deck application is not enabled or the helper is not available
+ * a QueryException is thrown instead.
+ *
+ * @return \OCA\Deck\Sharing\ShareAPIHelper
+ * @throws QueryException
+ */
+ private function getDeckShareHelper() {
+ if (!$this->appManager->isEnabledForUser('deck')) {
+ throw new QueryException();
+ }
+
+ return $this->serverContainer->query('\OCA\Deck\Sharing\ShareAPIHelper');
+ }
}