diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2021-12-13 19:29:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-13 19:29:13 +0300 |
commit | 76cb8b2af5fc4e0c4d71d42bbc7c1481d125fdfa (patch) | |
tree | 5d152e64532c8a13b10fa1e3e2f55e1e279b64da | |
parent | 408258161b640a5dca56d72bf3296126fc9ebe00 (diff) | |
parent | f02376f348f4538c884b32a571d6f8d3a929e5fd (diff) |
Merge pull request #5842 from nextcloud/backport/5840/stable1.11
[stable1.11] Remove command to fix threads and make it a repair step instead.
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | lib/Migration/RepairMailTheads.php (renamed from lib/Command/RepairMailTheads.php) | 23 |
2 files changed, 8 insertions, 17 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml index 08c702bab..3898edd8f 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -47,6 +47,7 @@ <step>OCA\Mail\Migration\FixBackgroundJobs</step> <step>OCA\Mail\Migration\MakeItineraryExtractorExecutable</step> <step>OCA\Mail\Migration\ProvisionAccounts</step> + <step>OCA\Mail\Command\RepairMailTheads</step> </post-migration> </repair-steps> <commands> @@ -61,7 +62,6 @@ <command>OCA\Mail\Command\SyncAccount</command> <command>OCA\Mail\Command\TrainAccount</command> <command>OCA\Mail\Command\Thread</command> - <command>OCA\Mail\Command\RepairMailTheads</command> </commands> <settings> <admin>OCA\Mail\Settings\AdminSettings</admin> diff --git a/lib/Command/RepairMailTheads.php b/lib/Migration/RepairMailTheads.php index 118eb3324..75f2966b5 100644 --- a/lib/Command/RepairMailTheads.php +++ b/lib/Migration/RepairMailTheads.php @@ -24,12 +24,11 @@ declare(strict_types=1); namespace OCA\Mail\Command; use OCA\Mail\Db\MessageMapper; +use OCP\Migration\IOutput; +use OCP\Migration\IRepairStep; use Psr\Log\LoggerInterface; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -class RepairMailTheads extends Command { +class RepairMailTheads implements IRepairStep { /** @var MessageMapper */ private $mapper; @@ -39,25 +38,17 @@ class RepairMailTheads extends Command { public function __construct(MessageMapper $mapper, LoggerInterface $logger) { - parent::__construct(); - $this->mapper = $mapper; $this->logger = $logger; } - /** - * @return void - */ - protected function configure(): void { - $this->setName('mail:repair:threads'); - $this->setDescription('Repair Broken Threads for all mail accounts'); + public function getName(): string { + return 'Repair Broken Threads for all mail accounts'; } - protected function execute(InputInterface $input, OutputInterface $output): int { + public function run(IOutput $output): void { $count = $this->mapper->resetInReplyTo(); $this->logger->info('Repairing Mail Threading, ' . $count . ' messages updated'); - $output->writeln(''); - $output->writeln('Repaired threads, ' . $count . ' messages updated'); - return 0; + $output->info(sprintf('Repaired threads, %s messages updated', $count)); } } |