From 7f94c26bee29ca8abcd10201812d7bfab3e961ee Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 25 Mar 2024 19:53:04 +0100 Subject: [PATCH] Cache ThreadsOldUids based on bThreadSort true/false #1507 --- snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php index f65b84fab..866875b12 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php @@ -502,9 +502,11 @@ class MailClient { $oFolderInfo = $oMessageCollection->FolderInfo; + $bThreadSort = $this->bThreadSort && $this->oImapClient->hasCapability('SORT'); + $sSerializedHashKey = null; if ($oCacher && $oCacher->IsInited()) { - $sSerializedHashKey = "ThreadsOldUids/{$oFolderInfo->etag}"; + $sSerializedHashKey = "ThreadsOldUids/{$oFolderInfo->etag}/" . ($bThreadSort ? 'S' : 'N'); $sSerializedUids = $oCacher->Get($sSerializedHashKey); if (!empty($sSerializedUids)) { $aSerializedUids = \json_decode($sSerializedUids, true); @@ -517,7 +519,7 @@ class MailClient $aUids = []; - if ($this->bThreadSort && $this->oImapClient->hasCapability('SORT')) { + if ($bThreadSort) { $oParams = new MessageListParams; $oParams->sFolderName = $oFolderInfo->FullName; $oParams->sSort = 'DATE';