Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-03-15 16:36:23 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-03-15 16:36:23 +0300
commitef34b03c17331bdbabaf0cfa27d2537e76156647 (patch)
treedc65aceb1123b39f059a9310c98ee5bf8599da67 /lib/Service
parent458babfefc061148b8d29bfd41345d2434ce16b8 (diff)
Lock the full mailbox when doing a (forced) initial sync
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Service')
-rw-r--r--lib/Service/Sync/ImapToDbSynchronizer.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Service/Sync/ImapToDbSynchronizer.php b/lib/Service/Sync/ImapToDbSynchronizer.php
index 3132aad06..6e29147a1 100644
--- a/lib/Service/Sync/ImapToDbSynchronizer.php
+++ b/lib/Service/Sync/ImapToDbSynchronizer.php
@@ -197,15 +197,15 @@ class ImapToDbSynchronizer {
return;
}
- if ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS) {
+ if ($force || ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS)) {
$logger->debug("Locking mailbox " . $mailbox->getId() . " for new messages sync");
$this->mailboxMapper->lockForNewSync($mailbox);
}
- if ($criteria & Horde_Imap_Client::SYNC_FLAGSUIDS) {
+ if ($force || ($criteria & Horde_Imap_Client::SYNC_FLAGSUIDS)) {
$logger->debug("Locking mailbox " . $mailbox->getId() . " for changed messages sync");
$this->mailboxMapper->lockForChangeSync($mailbox);
}
- if ($criteria & Horde_Imap_Client::SYNC_VANISHEDUIDS) {
+ if ($force || ($criteria & Horde_Imap_Client::SYNC_VANISHEDUIDS)) {
$logger->debug("Locking mailbox " . $mailbox->getId() . " for vanished messages sync");
$this->mailboxMapper->lockForVanishedSync($mailbox);
}
@@ -241,15 +241,15 @@ class ImapToDbSynchronizer {
} catch (Throwable $e) {
throw new ServiceException('Sync failed for ' . $account->getId() . ':' . $mailbox->getName() . ': ' . $e->getMessage(), 0, $e);
} finally {
- if ($criteria & Horde_Imap_Client::SYNC_VANISHEDUIDS) {
+ if ($force || ($criteria & Horde_Imap_Client::SYNC_VANISHEDUIDS)) {
$logger->debug("Unlocking mailbox " . $mailbox->getId() . " from vanished messages sync");
$this->mailboxMapper->unlockFromVanishedSync($mailbox);
}
- if ($criteria & Horde_Imap_Client::SYNC_FLAGSUIDS) {
+ if ($force || ($criteria & Horde_Imap_Client::SYNC_FLAGSUIDS)) {
$logger->debug("Unlocking mailbox " . $mailbox->getId() . " from changed messages sync");
$this->mailboxMapper->unlockFromChangedSync($mailbox);
}
- if ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS) {
+ if ($force || ($criteria & Horde_Imap_Client::SYNC_NEWMSGSUIDS)) {
$logger->debug("Unlocking mailbox " . $mailbox->getId() . " from new messages sync");
$this->mailboxMapper->unlockFromNewSync($mailbox);
}