diff options
author | Anna Larch <anna@nextcloud.com> | 2021-05-06 23:36:20 +0300 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2021-05-26 16:38:18 +0300 |
commit | 540ca4b1ef164f1a05e8c4f457ed8aca7ccebabd (patch) | |
tree | 20a536d98ca52f81010478c620208a2cbe5e6b90 /lib/Service | |
parent | 4f5692a41c64d7878c9e6a167c72665cf70b8a33 (diff) |
Add bg job for label sync
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/MailManager.php | 8 | ||||
-rw-r--r-- | lib/Service/Sync/SyncService.php | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/Service/MailManager.php b/lib/Service/MailManager.php index bd87e3b13..29030a000 100644 --- a/lib/Service/MailManager.php +++ b/lib/Service/MailManager.php @@ -388,9 +388,9 @@ class MailManager implements IMailManager { continue; } if ($value) { - $this->imapMessageMapper->addFlag($client, $mb, $uid, $imapFlag); + $this->imapMessageMapper->addFlag($client, $mb, [$uid], $imapFlag); } else { - $this->imapMessageMapper->removeFlag($client, $mb, $uid, $imapFlag); + $this->imapMessageMapper->removeFlag($client, $mb, [$uid], $imapFlag); } } } catch (Horde_Imap_Client_Exception $e) { @@ -438,9 +438,9 @@ class MailManager implements IMailManager { try { if ($value) { // imap keywords and flags work the same way - $this->imapMessageMapper->addFlag($client, $mb, $message->getUid(), $tag->getImapLabel()); + $this->imapMessageMapper->addFlag($client, $mb, [$message->getUid()], $tag->getImapLabel()); } else { - $this->imapMessageMapper->removeFlag($client, $mb, $message->getUid(), $tag->getImapLabel()); + $this->imapMessageMapper->removeFlag($client, $mb, [$message->getUid()], $tag->getImapLabel()); } } catch (Horde_Imap_Client_Exception $e) { throw new ServiceException( diff --git a/lib/Service/Sync/SyncService.php b/lib/Service/Sync/SyncService.php index f5ea294c5..9f56e383a 100644 --- a/lib/Service/Sync/SyncService.php +++ b/lib/Service/Sync/SyncService.php @@ -111,7 +111,7 @@ class SyncService { public function syncMailbox(Account $account, Mailbox $mailbox, int $criteria, - array $knownIds, + array $knownIds = null, bool $partialOnly, string $filter = null): Response { if ($partialOnly && !$mailbox->isCached()) { @@ -123,7 +123,7 @@ class SyncService { $mailbox, $this->logger, $criteria, - $this->messageMapper->findUidsForIds($mailbox, $knownIds), + $knownIds === null ? null : $this->messageMapper->findUidsForIds($mailbox, $knownIds), !$partialOnly ); @@ -133,7 +133,7 @@ class SyncService { return $this->getDatabaseSyncChanges( $account, $mailbox, - $knownIds, + $knownIds ?? [], $query ); } |