From 7f8707c4c0cfff6eca4c872fe5948d41f2669dcc Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Wed, 18 Jan 2023 08:38:26 +0100 Subject: [PATCH] Cleanup messages cache handling --- dev/Model/FolderCollection.js | 4 +-- .../0.0.0/app/libraries/RainLoop/Actions.php | 1 - .../libraries/RainLoop/Actions/Messages.php | 26 +++---------------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/dev/Model/FolderCollection.js b/dev/Model/FolderCollection.js index 316e936ae..e0fbed084 100644 --- a/dev/Model/FolderCollection.js +++ b/dev/Model/FolderCollection.js @@ -270,9 +270,7 @@ export class FolderCollectionModel extends AbstractCollectionModel FolderUserStore.namespace = this.namespace; // 'THREAD=REFS', 'THREAD=REFERENCES', 'THREAD=ORDEREDSUBJECT' - AppUserStore.threadsAllowed(!!( - Settings.app('useImapThread') && this.capabilities.some(capa => capa.startsWith('THREAD=')) - )); + AppUserStore.threadsAllowed(!!this.capabilities.some(capa => capa.startsWith('THREAD='))); // FolderUserStore.folderListOptimized(!!this.optimized); FolderUserStore.quotaUsage(this.quotaUsage); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index 44d03087b..d721bd18e 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -729,7 +729,6 @@ class Actions $aResult['System'], array( 'allowHtmlEditorBitiButtons' => (bool)$oConfig->Get('labs', 'allow_html_editor_biti_buttons', false), 'allowCtrlEnterOnCompose' => (bool)$oConfig->Get('labs', 'allow_ctrl_enter_on_compose', false), - 'useImapThread' => (bool)$oConfig->Get('imap', 'use_thread', true), 'allowAppendMessage' => (bool)$oConfig->Get('labs', 'allow_message_append', false), 'folderSpecLimit' => (int)$oConfig->Get('labs', 'folders_spec_limit', 50), 'listPermanentFiltered' => '' !== \trim($oConfig->Get('imap', 'message_list_permanent_filter', '')), diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php index e5f1b7f8b..5d4b76270 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php @@ -73,11 +73,10 @@ trait Messages try { - if (!$this->Config()->Get('imap', 'use_thread', true)) { - $oParams->bUseThreads = false; + if ($this->Config()->Get('cache', 'enable', true) && $this->Config()->Get('cache', 'server_uids', false)) { + $oParams->oCacher = $this->Cacher($oAccount); } - $oParams->oCacher = $this->cacherForUids(); $oParams->bUseSort = true; $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); @@ -424,7 +423,7 @@ trait Messages try { - $oMessage = $this->MailClient()->Message($sFolder, $iUid, true, $this->cacherForThreads()); + $oMessage = $this->MailClient()->Message($sFolder, $iUid, true, $this->Cacher($oAccount)); } catch (\Throwable $oException) { @@ -901,25 +900,6 @@ trait Messages } } - /** - * @return MailSo\Cache\CacheClient|null - */ - private function cacherForUids() - { - $oAccount = $this->getAccountFromToken(false); - return ($this->Config()->Get('cache', 'enable', true) && - $this->Config()->Get('cache', 'server_uids', false)) ? $this->Cacher($oAccount) : null; - } - - /** - * @return MailSo\Cache\CacheClient|null - */ - private function cacherForThreads() - { - $oAccount = $this->getAccountFromToken(false); - return !!$this->Config()->Get('imap', 'use_thread', true) ? $this->Cacher($oAccount) : null; - } - private function buildReadReceiptMessage(Account $oAccount) : \MailSo\Mime\Message { $sReadReceipt = $this->GetActionParam('ReadReceipt', '');