Skip to content
3 changes: 3 additions & 0 deletions apps/files_sharing/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
'OCA\\Files_Sharing\\Migration\\Version33000Date20251030081948' => $baseDir . '/../lib/Migration/Version33000Date20251030081948.php',
'OCA\\Files_Sharing\\Migration\\Version33000Date20260306120000' => $baseDir . '/../lib/Migration/Version33000Date20260306120000.php',
'OCA\\Files_Sharing\\Migration\\Version33000Date20260306150000' => $baseDir . '/../lib/Migration/Version33000Date20260306150000.php',
'OCA\\Files_Sharing\\Migration\\Version35000Date20260720121254' => $baseDir . '/../lib/Migration/Version35000Date20260720121254.php',
'OCA\\Files_Sharing\\Migration\\Version35000Date20260813121254' => $baseDir . '/../lib/Migration/Version35000Date20260813121254.php',
'OCA\\Files_Sharing\\MountProvider' => $baseDir . '/../lib/MountProvider.php',
'OCA\\Files_Sharing\\Notification\\Listener' => $baseDir . '/../lib/Notification/Listener.php',
'OCA\\Files_Sharing\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
Expand All @@ -107,6 +109,7 @@
'OCA\\Files_Sharing\\SharedMount' => $baseDir . '/../lib/SharedMount.php',
'OCA\\Files_Sharing\\SharedStorage' => $baseDir . '/../lib/SharedStorage.php',
'OCA\\Files_Sharing\\SharesReminderJob' => $baseDir . '/../lib/SharesReminderJob.php',
'OCA\\Files_Sharing\\Sharing\\LegacyBackend' => $baseDir . '/../lib/Sharing/LegacyBackend.php',
'OCA\\Files_Sharing\\Updater' => $baseDir . '/../lib/Updater.php',
'OCA\\Files_Sharing\\ViewOnly' => $baseDir . '/../lib/ViewOnly.php',
);
3 changes: 3 additions & 0 deletions apps/files_sharing/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class ComposerStaticInitFiles_Sharing
'OCA\\Files_Sharing\\Migration\\Version33000Date20251030081948' => __DIR__ . '/..' . '/../lib/Migration/Version33000Date20251030081948.php',
'OCA\\Files_Sharing\\Migration\\Version33000Date20260306120000' => __DIR__ . '/..' . '/../lib/Migration/Version33000Date20260306120000.php',
'OCA\\Files_Sharing\\Migration\\Version33000Date20260306150000' => __DIR__ . '/..' . '/../lib/Migration/Version33000Date20260306150000.php',
'OCA\\Files_Sharing\\Migration\\Version35000Date20260720121254' => __DIR__ . '/..' . '/../lib/Migration/Version35000Date20260720121254.php',
'OCA\\Files_Sharing\\Migration\\Version35000Date20260813121254' => __DIR__ . '/..' . '/../lib/Migration/Version35000Date20260813121254.php',
'OCA\\Files_Sharing\\MountProvider' => __DIR__ . '/..' . '/../lib/MountProvider.php',
'OCA\\Files_Sharing\\Notification\\Listener' => __DIR__ . '/..' . '/../lib/Notification/Listener.php',
'OCA\\Files_Sharing\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
Expand All @@ -122,6 +124,7 @@ class ComposerStaticInitFiles_Sharing
'OCA\\Files_Sharing\\SharedMount' => __DIR__ . '/..' . '/../lib/SharedMount.php',
'OCA\\Files_Sharing\\SharedStorage' => __DIR__ . '/..' . '/../lib/SharedStorage.php',
'OCA\\Files_Sharing\\SharesReminderJob' => __DIR__ . '/..' . '/../lib/SharesReminderJob.php',
'OCA\\Files_Sharing\\Sharing\\LegacyBackend' => __DIR__ . '/..' . '/../lib/Sharing/LegacyBackend.php',
'OCA\\Files_Sharing\\Updater' => __DIR__ . '/..' . '/../lib/Updater.php',
'OCA\\Files_Sharing\\ViewOnly' => __DIR__ . '/..' . '/../lib/ViewOnly.php',
);
Expand Down
6 changes: 6 additions & 0 deletions apps/files_sharing/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace OCA\Files_Sharing\AppInfo;

use NCU\Sharing\ISharingRegistry;
use OC\Group\DisplayNameCache as GroupDisplayNameCache;
use OC\User\DisplayNameCache;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
Expand Down Expand Up @@ -36,6 +37,7 @@
use OCA\Files_Sharing\MountProvider;
use OCA\Files_Sharing\Notification\Listener;
use OCA\Files_Sharing\Notification\Notifier;
use OCA\Files_Sharing\Sharing\LegacyBackend;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
Expand All @@ -58,6 +60,7 @@
use OCP\IDBConnection;
use OCP\IGroup;
use OCP\Interaction\RestrictInteractionEvent;
use OCP\Server;
use OCP\Share\Events\BeforeShareDeletedEvent;
use OCP\Share\Events\ShareCreatedEvent;
use OCP\Share\Events\ShareMovedEvent;
Expand Down Expand Up @@ -136,6 +139,9 @@ function () use ($c) {
$context->registerConfigLexicon(ConfigLexicon::class);

$context->registerEventListener(RestrictInteractionEvent::class, RestrictInteractionListener::class);

$registry = Server::get(ISharingRegistry::class);
$registry->registerLegacyBackend(Server::get(LegacyBackend::class));
}

#[\Override]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Files_Sharing\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

class Version35000Date20260720121254 extends SimpleMigrationStep {
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$shareLegacyMappingTable = $schema->createTable('share_legacy_mapping');
$shareLegacyMappingTable->addColumn('id', Types::BIGINT);
$shareLegacyMappingTable->addColumn('legacy_provider', Types::STRING, ['length' => 128]);
$shareLegacyMappingTable->addColumn('legacy_id', Types::STRING, ['length' => 128]);
$shareLegacyMappingTable->setPrimaryKey(['id']);
$shareLegacyMappingTable->addUniqueIndex(['legacy_provider', 'legacy_id']);

return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Files_Sharing\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\Attributes\AddColumn;
use OCP\Migration\Attributes\AddIndex;
use OCP\Migration\Attributes\CreateTable;
use OCP\Migration\Attributes\DropColumn;
use OCP\Migration\Attributes\DropIndex;
use OCP\Migration\Attributes\IndexType;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

#[CreateTable(table: 'sharing_classmap')]
#[DropIndex(table: 'share_legacy_mapping', type: IndexType::PRIMARY)]
#[DropIndex(table: 'share_legacy_mapping', type: IndexType::UNIQUE)]
#[AddIndex(table: 'share_legacy_mapping', type: IndexType::PRIMARY)]
#[AddIndex(table: 'share_legacy_mapping', type: IndexType::INDEX)]
class Version35000Date20260813121254 extends SimpleMigrationStep {
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$shareLegacyMappingTable = $schema->getTable('share_legacy_mapping');
$shareLegacyMappingTable->dropPrimaryKey();
$shareLegacyMappingTable->setPrimaryKey(['legacy_provider', 'legacy_id']);
$shareLegacyMappingTable->addIndex(['id']);

return null;
}
}
Loading
Loading