From f6ba0edf5db3bcb1312b144e2f0d4476c9b0ee19 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Sat, 31 Aug 2024 12:52:49 +0200 Subject: [PATCH] chore: remove duplicated DatabaseMessageMapper injection Signed-off-by: Richard Steinmetz --- lib/Service/Sync/ImapToDbSynchronizer.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/Service/Sync/ImapToDbSynchronizer.php b/lib/Service/Sync/ImapToDbSynchronizer.php index 68f35c5d49..c0aa649ed7 100644 --- a/lib/Service/Sync/ImapToDbSynchronizer.php +++ b/lib/Service/Sync/ImapToDbSynchronizer.php @@ -56,9 +56,6 @@ class ImapToDbSynchronizer { /** @var MailboxMapper */ private $mailboxMapper; - /** @var DatabaseMessageMapper */ - private $messageMapper; - /** @var Synchronizer */ private $synchronizer; @@ -78,7 +75,6 @@ public function __construct(DatabaseMessageMapper $dbMapper, IMAPClientFactory $clientFactory, ImapMessageMapper $imapMapper, MailboxMapper $mailboxMapper, - DatabaseMessageMapper $messageMapper, Synchronizer $synchronizer, IEventDispatcher $dispatcher, PerformanceLogger $performanceLogger, @@ -88,7 +84,6 @@ public function __construct(DatabaseMessageMapper $dbMapper, $this->clientFactory = $clientFactory; $this->imapMapper = $imapMapper; $this->mailboxMapper = $mailboxMapper; - $this->messageMapper = $messageMapper; $this->synchronizer = $synchronizer; $this->dispatcher = $dispatcher; $this->performanceLogger = $performanceLogger; @@ -177,7 +172,7 @@ public function clearCache(Account $account, */ private function resetCache(Account $account, Mailbox $mailbox): void { $id = $account->getId() . ':' . $mailbox->getName(); - $this->messageMapper->deleteAll($mailbox); + $this->dbMapper->deleteAll($mailbox); $this->logger->debug("All messages of $id cleared"); $mailbox->setSyncNewToken(null); $mailbox->setSyncChangedToken(null); @@ -341,7 +336,7 @@ private function runInitialSync( // We might need more attempts to fill the cache $loggingMailboxId = $account->getId() . ':' . $mailbox->getName(); $total = $imapMessages['total']; - $cached = count($this->messageMapper->findAllUids($mailbox)); + $cached = count($this->dbMapper->findAllUids($mailbox)); $perf->step('find number of cached UIDs'); $perf->end();