From f3150f29a7256a502df6990dd9f8126d76fe3a80 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Thu, 3 Dec 2020 16:03:35 +0100 Subject: Introduce deck share type to ShareAPIController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files/lib/Controller/ApiController.php | 3 ++- apps/files/lib/Service/OwnershipTransferService.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'apps/files') diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index ee4d86bc360..7c0f9bba259 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -221,7 +221,8 @@ class ApiController extends Controller { IShare::TYPE_LINK, IShare::TYPE_REMOTE, IShare::TYPE_EMAIL, - IShare::TYPE_ROOM + IShare::TYPE_ROOM, + IShare::TYPE_DECK ]; foreach ($requestedShareTypes as $requestedShareType) { // one of each type is enough to find out about the types diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php index fa979c2006a..bd8520b92fc 100644 --- a/apps/files/lib/Service/OwnershipTransferService.php +++ b/apps/files/lib/Service/OwnershipTransferService.php @@ -252,7 +252,7 @@ class OwnershipTransferService { $shares = []; $progress = new ProgressBar($output); - foreach ([IShare::TYPE_GROUP, IShare::TYPE_USER, IShare::TYPE_LINK, IShare::TYPE_REMOTE, IShare::TYPE_ROOM, IShare::TYPE_EMAIL, IShare::TYPE_CIRCLE] as $shareType) { + foreach ([IShare::TYPE_GROUP, IShare::TYPE_USER, IShare::TYPE_LINK, IShare::TYPE_REMOTE, IShare::TYPE_ROOM, IShare::TYPE_EMAIL, IShare::TYPE_CIRCLE, IShare::TYPE_DECK] as $shareType) { $offset = 0; while (true) { $sharePage = $this->shareManager->getSharesBy($sourceUid, $shareType, null, true, 50, $offset); -- cgit v1.2.3 From c4ea37b8a102adec16cf13085dba2fd7ef893195 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Wed, 9 Dec 2020 13:19:14 +0100 Subject: Address minor comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files/lib/Controller/ApiController.php | 2 +- apps/files_sharing/lib/Controller/DeletedShareAPIController.php | 4 ++-- apps/files_sharing/lib/Controller/ShareAPIController.php | 4 ++-- apps/files_sharing/tests/Controller/ShareAPIControllerTest.php | 8 ++++---- lib/private/Share/Constants.php | 3 ++- lib/public/Share/IShare.php | 3 ++- 6 files changed, 13 insertions(+), 11 deletions(-) (limited to 'apps/files') diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index 7c0f9bba259..f7a0674eff0 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -222,7 +222,7 @@ class ApiController extends Controller { IShare::TYPE_REMOTE, IShare::TYPE_EMAIL, IShare::TYPE_ROOM, - IShare::TYPE_DECK + IShare::TYPE_DECK, ]; foreach ($requestedShareTypes as $requestedShareType) { // one of each type is enough to find out about the types diff --git a/apps/files_sharing/lib/Controller/DeletedShareAPIController.php b/apps/files_sharing/lib/Controller/DeletedShareAPIController.php index 1981c0c1945..9a757412316 100644 --- a/apps/files_sharing/lib/Controller/DeletedShareAPIController.php +++ b/apps/files_sharing/lib/Controller/DeletedShareAPIController.php @@ -220,7 +220,7 @@ class DeletedShareAPIController extends OCSController { throw new QueryException(); } - return $this->serverContainer->query('\OCA\Talk\Share\Helper\DeletedShareAPIController'); + return $this->serverContainer->get('\OCA\Talk\Share\Helper\DeletedShareAPIController'); } /** @@ -237,6 +237,6 @@ class DeletedShareAPIController extends OCSController { throw new QueryException(); } - return $this->serverContainer->query('\OCA\Deck\Sharing\ShareAPIHelper'); + return $this->serverContainer->get('\OCA\Deck\Sharing\ShareAPIHelper'); } } diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 399ff18fba8..65de654be92 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1558,7 +1558,7 @@ class ShareAPIController extends OCSController { throw new QueryException(); } - return $this->serverContainer->query('\OCA\Talk\Share\Helper\ShareAPIController'); + return $this->serverContainer->get('\OCA\Talk\Share\Helper\ShareAPIController'); } /** @@ -1575,7 +1575,7 @@ class ShareAPIController extends OCSController { throw new QueryException(); } - return $this->serverContainer->query('\OCA\Deck\Sharing\ShareAPIHelper'); + return $this->serverContainer->get('\OCA\Deck\Sharing\ShareAPIHelper'); } /** diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index 729fe27f69e..a2a6ab59809 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -1558,7 +1558,7 @@ class ShareAPIControllerTest extends TestCase { ->with($share, $this->currentUser) ->willReturn($canAccessShareByHelper); - $this->serverContainer->method('query') + $this->serverContainer->method('get') ->with('\OCA\Talk\Share\Helper\ShareAPIController') ->willReturn($helper); } @@ -2222,7 +2222,7 @@ class ShareAPIControllerTest extends TestCase { } ); - $this->serverContainer->method('query') + $this->serverContainer->method('get') ->with('\OCA\Talk\Share\Helper\ShareAPIController') ->willReturn($helper); @@ -2340,7 +2340,7 @@ class ShareAPIControllerTest extends TestCase { } ); - $this->serverContainer->method('query') + $this->serverContainer->method('get') ->with('\OCA\Talk\Share\Helper\ShareAPIController') ->willReturn($helper); @@ -4404,7 +4404,7 @@ class ShareAPIControllerTest extends TestCase { ->with($share) ->willReturn($formatShareByHelper); - $this->serverContainer->method('query') + $this->serverContainer->method('get') ->with('\OCA\Talk\Share\Helper\ShareAPIController') ->willReturn($helper); } diff --git a/lib/private/Share/Constants.php b/lib/private/Share/Constants.php index 0ba68428c87..77ed3176277 100644 --- a/lib/private/Share/Constants.php +++ b/lib/private/Share/Constants.php @@ -71,9 +71,10 @@ class Constants { public const SHARE_TYPE_ROOM = 10; // const SHARE_TYPE_USERROOM = 11; // Internal type used by RoomShareProvider /** - * @deprecated 21.0.0 - use IShare::TYPE_ROOM instead + * @deprecated 21.0.0 - use IShare::TYPE_DECK instead */ public const SHARE_TYPE_DECK = 12; + // const SHARE_TYPE_DECK_USER = 13; // Internal type used by DeckShareProvider public const FORMAT_NONE = -1; public const FORMAT_STATUSES = -2; diff --git a/lib/public/Share/IShare.php b/lib/public/Share/IShare.php index 4bd290d66c8..86aceba80f5 100644 --- a/lib/public/Share/IShare.php +++ b/lib/public/Share/IShare.php @@ -111,7 +111,8 @@ interface IShare { public const TYPE_DECK = 12; /** - * @internal 21.00 + * @internal + * @since 21.0.0 */ public const TYPE_DECK_USER = 13; -- cgit v1.2.3