mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix(dav): Skip removal of classified activity only once
Was fixed in Nextcloud 16, so future versions should not generate this anymore. So the delete attempt can be skipped, after doing it once. We are keeping this to ensure it also runs after migrating from ownCloud Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
1e833cea34
commit
bd91d011f8
1 changed files with 7 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ declare(strict_types=1);
|
|||
namespace OCA\DAV\Migration;
|
||||
|
||||
use OCA\DAV\CalDAV\CalDavBackend;
|
||||
use OCP\AppFramework\Services\IAppConfig;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\IRepairStep;
|
||||
|
|
@ -17,6 +18,7 @@ class RemoveClassifiedEventActivity implements IRepairStep {
|
|||
|
||||
public function __construct(
|
||||
private IDBConnection $connection,
|
||||
private IAppConfig $appConfig,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
@ -33,12 +35,17 @@ class RemoveClassifiedEventActivity implements IRepairStep {
|
|||
*/
|
||||
#[\Override]
|
||||
public function run(IOutput $output) {
|
||||
if ($this->appConfig->getAppValueBool('checked_for_classified_activity')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$this->connection->tableExists('activity')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$deletedEvents = $this->removePrivateEventActivity();
|
||||
$deletedEvents += $this->removeConfidentialUncensoredEventActivity();
|
||||
$this->appConfig->setAppValueBool('checked_for_classified_activity', true);
|
||||
|
||||
$output->info("Removed $deletedEvents activity entries");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue