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>2020-09-23 21:43:35 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-09-24 08:53:49 +0300
commit23e3cc48ff48241f5cf06d38cd342312bd14d9a1 (patch)
tree7143867aedf8b93d075d1192795908cf457b184b /lib/Contracts
parentfe89d38446e437994056c2efe386e1bf212977b9 (diff)
Add a flag that indicates whether an inbox should be sync'ed
The cron background sync can be expensive with accounts that have many mailboxes. As it turns out other clients like Thunderbird also don't look into *all* mailboxes to check for new email. Instead they only do that for INBOX by default and let the user pick more mailboxes if they wish. We should do the same. This adds a simple flag. Only the inbox and mailboxes that have this flag set will get a sync in background. Any other mailbox can still be used, but the sync only happens if the user has the mailbox open. This will bring down the load on instances with many accounts, especially if those have many mailboxes. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Contracts')
-rw-r--r--lib/Contracts/IMailManager.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Contracts/IMailManager.php b/lib/Contracts/IMailManager.php
index cbe727933..d80a8bcc1 100644
--- a/lib/Contracts/IMailManager.php
+++ b/lib/Contracts/IMailManager.php
@@ -209,4 +209,15 @@ interface IMailManager {
public function updateSubscription(Account $account,
Mailbox $mailbox,
bool $subscribed): Mailbox;
+
+ /**
+ * @param string $mailbox
+ * @param bool $syncInBackground
+ *
+ * @return Mailbox
+ * @throws ClientException
+ * @throws ServiceException
+ */
+ public function enableMailboxBackgroundSync(Mailbox $mailbox,
+ bool $syncInBackground): Mailbox;
}