diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-10-02 12:47:00 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-01-31 18:43:51 +0300 |
commit | c287787f8df599b567f399f6022ffc88db3a0582 (patch) | |
tree | 6d1863eff65f5c43db73c1e36df6938c505ef58e /lib/Controller/MessagesController.php | |
parent | 31f89d71f860c8c2f75234537a8d64f38da696ab (diff) |
Add a cache for IMAP message in the database
Co-authored-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/Controller/MessagesController.php')
-rwxr-xr-x | lib/Controller/MessagesController.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Controller/MessagesController.php b/lib/Controller/MessagesController.php index 2764bbb3c..7e075621e 100755 --- a/lib/Controller/MessagesController.php +++ b/lib/Controller/MessagesController.php @@ -40,6 +40,7 @@ use OCA\Mail\Model\IMAPMessage; use OCA\Mail\Service\AccountService; use OCA\Mail\Service\IMailBox; use OCA\Mail\Service\ItineraryService; +use OCA\Mail\Service\SyncService; use OCP\AppFramework\Controller; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Http; @@ -69,6 +70,9 @@ class MessagesController extends Controller { /** @var ItineraryService */ private $itineraryService; + /** @var SyncService */ + private $syncService; + /** @var string */ private $currentUserId; @@ -104,6 +108,7 @@ class MessagesController extends Controller { IMailManager $mailManager, IMailSearch $mailSearch, ItineraryService $itineraryService, + SyncService $syncService, string $UserId, $userFolder, ILogger $logger, @@ -116,6 +121,7 @@ class MessagesController extends Controller { $this->mailManager = $mailManager; $this->mailSearch = $mailSearch; $this->itineraryService = $itineraryService; + $this->syncService = $syncService; $this->currentUserId = $UserId; $this->userFolder = $userFolder; $this->logger = $logger; @@ -144,6 +150,11 @@ class MessagesController extends Controller { return new JSONResponse(null, Http::STATUS_FORBIDDEN); } + $this->syncService->ensurePopulated( + $account, + base64_decode($folderId) + ); + $this->logger->debug("loading messages of folder <$folderId>"); return new JSONResponse( |