From 3ab83cc16ecde5a7de85d98e8029f5f397dfe002 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Mon, 28 Jun 2021 19:55:24 -0100 Subject: [PATCH] removing deprecated code Signed-off-by: Maxence Lange --- appinfo/info.xml | 4 +-- lib/Circles/FileSharingBroadcaster.php | 5 ++++ lib/Command/MembersRemove.php | 39 ++++++++++++++++++++++--- lib/Cron/GlobalSync.php | 34 ++++++++++----------- lib/MountManager/CircleMountManager.php | 2 +- lib/Service/DavService.php | 2 +- lib/ShareByCircleProviderDeprecated.php | 2 ++ 7 files changed, 62 insertions(+), 26 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index e20d44116..2308e1780 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -67,9 +67,7 @@ Those groups of users (or "circles") can then be used by any other app for shari OCA\Circles\Command\MembersDetails OCA\Circles\Command\MembersLevel OCA\Circles\Command\MembersRemove - OCA\Circles\Command\SyncContact - - OCA\Circles\Command\FixUniqueId + diff --git a/lib/Circles/FileSharingBroadcaster.php b/lib/Circles/FileSharingBroadcaster.php index 914b8e300..350480625 100644 --- a/lib/Circles/FileSharingBroadcaster.php +++ b/lib/Circles/FileSharingBroadcaster.php @@ -59,6 +59,11 @@ use OCP\Util; +/** + * Class FileSharingBroadcaster + * @deprecated + * @package OCA\Circles\Circles + */ class FileSharingBroadcaster implements IBroadcaster { diff --git a/lib/Command/MembersRemove.php b/lib/Command/MembersRemove.php index 34ed980cf..7959e7c5e 100644 --- a/lib/Command/MembersRemove.php +++ b/lib/Command/MembersRemove.php @@ -34,11 +34,27 @@ use Exception; use OC\Core\Command\Base; use OCA\Circles\Db\MemberRequest; +use OCA\Circles\Exceptions\CircleNotFoundException; +use OCA\Circles\Exceptions\FederatedEventException; +use OCA\Circles\Exceptions\FederatedItemException; +use OCA\Circles\Exceptions\FederatedUserException; +use OCA\Circles\Exceptions\FederatedUserNotFoundException; +use OCA\Circles\Exceptions\InitiatorNotConfirmedException; +use OCA\Circles\Exceptions\InitiatorNotFoundException; +use OCA\Circles\Exceptions\InvalidIdException; use OCA\Circles\Exceptions\MemberDoesNotExistException; +use OCA\Circles\Exceptions\MemberNotFoundException; +use OCA\Circles\Exceptions\OwnerNotFoundException; +use OCA\Circles\Exceptions\RemoteInstanceException; +use OCA\Circles\Exceptions\RemoteNotFoundException; +use OCA\Circles\Exceptions\RemoteResourceNotFoundException; +use OCA\Circles\Exceptions\RequestBuilderException; +use OCA\Circles\Exceptions\SingleCircleNotFoundException; +use OCA\Circles\Exceptions\UnknownRemoteException; +use OCA\Circles\Exceptions\UserTypeNotFoundException; use OCA\Circles\Model\Member; use OCA\Circles\Service\FederatedUserService; use OCA\Circles\Service\MemberService; -use OCA\Circles\Service\MembersService; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -59,7 +75,7 @@ class MembersRemove extends Base { /** @var FederatedUserService */ private $federatedUserService; - /** @var MembersService */ + /** @var MemberService */ private $memberService; @@ -95,8 +111,23 @@ protected function configure() { * @param OutputInterface $output * * @return int - * @throws MemberDoesNotExistException - * @throws Exception + * @throws CircleNotFoundException + * @throws FederatedEventException + * @throws FederatedItemException + * @throws FederatedUserException + * @throws FederatedUserNotFoundException + * @throws InitiatorNotConfirmedException + * @throws InitiatorNotFoundException + * @throws InvalidIdException + * @throws MemberNotFoundException + * @throws OwnerNotFoundException + * @throws RemoteInstanceException + * @throws RemoteNotFoundException + * @throws RemoteResourceNotFoundException + * @throws RequestBuilderException + * @throws SingleCircleNotFoundException + * @throws UnknownRemoteException + * @throws UserTypeNotFoundException */ protected function execute(InputInterface $input, OutputInterface $output): int { $memberId = $input->getArgument('member_id'); diff --git a/lib/Cron/GlobalSync.php b/lib/Cron/GlobalSync.php index a1f001f84..885cdb7c8 100644 --- a/lib/Cron/GlobalSync.php +++ b/lib/Cron/GlobalSync.php @@ -61,23 +61,23 @@ public function __construct() { */ protected function run($argument) { return; - $app = \OC::$server->query(Application::class); - $c = $app->getContainer(); - - /** @var CirclesService $circlesService */ - $circlesService = $c->query(CirclesService::class); - /** @var MembersService $membersService */ - $membersService = $c->query(MembersService::class); - /** @var GSUpstreamService $gsUpstreamService */ - $gsUpstreamService = $c->query(GSUpstreamService::class); - - $circles = $circlesService->getCirclesToSync(); - - foreach ($circles as $circle) { - $membersService->updateCachedFromCircle($circle); - } - - $gsUpstreamService->synchronize($circles); +// $app = \OC::$server->query(Application::class); +// $c = $app->getContainer(); +// +// /** @var CirclesService $circlesService */ +// $circlesService = $c->query(CirclesService::class); +// /** @var MembersService $membersService */ +// $membersService = $c->query(MembersService::class); +// /** @var GSUpstreamService $gsUpstreamService */ +// $gsUpstreamService = $c->query(GSUpstreamService::class); +// +// $circles = $circlesService->getCirclesToSync(); +// +// foreach ($circles as $circle) { +// $membersService->updateCachedFromCircle($circle); +// } +// +// $gsUpstreamService->synchronize($circles); } } diff --git a/lib/MountManager/CircleMountManager.php b/lib/MountManager/CircleMountManager.php index defd9a66c..5d9998a12 100644 --- a/lib/MountManager/CircleMountManager.php +++ b/lib/MountManager/CircleMountManager.php @@ -37,7 +37,7 @@ /** * Class CircleMountManager - * + * @deprecated * @package OCA\Circles\MountManager */ class CircleMountManager { diff --git a/lib/Service/DavService.php b/lib/Service/DavService.php index 32ce80653..88a9fd740 100644 --- a/lib/Service/DavService.php +++ b/lib/Service/DavService.php @@ -51,7 +51,7 @@ /** * Class DavService - * + * @deprecated * @package OCA\Circles\Service */ class DavService { diff --git a/lib/ShareByCircleProviderDeprecated.php b/lib/ShareByCircleProviderDeprecated.php index 6c0732e19..ae611a0ed 100644 --- a/lib/ShareByCircleProviderDeprecated.php +++ b/lib/ShareByCircleProviderDeprecated.php @@ -129,6 +129,8 @@ public function __construct( IDBConnection $connection, ISecureRandom $secureRandom, IUserManager $userManager, IRootFolder $rootFolder, IL10N $l10n, ILogger $logger, IURLGenerator $urlGenerator ) { + // kept but should not be loaded + exit(); $app = \OC::$server->query(Application::class); $container = $app->getContainer(); $configService = $container->query(ConfigService::class);