mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 23:08:08 +08:00
Protect MessageListThreadsMap()
This commit is contained in:
parent
34543d5bf3
commit
6abcbd16c4
1 changed files with 7 additions and 5 deletions
|
@ -406,8 +406,9 @@ class MailClient
|
|||
* @throws \MailSo\Net\Exceptions\*
|
||||
* @throws \MailSo\Imap\Exceptions\*
|
||||
*/
|
||||
public function MessageListThreadsMap(string $sFolderName, string $sFolderHash, ?\MailSo\Cache\CacheClient $oCacher) : array
|
||||
protected function MessageListThreadsMap(MessageCollection $oMessageCollection, ?\MailSo\Cache\CacheClient $oCacher) : array
|
||||
{
|
||||
$sFolderName = $oMessageCollection->FolderName;
|
||||
// $iThreadLimit = $this->oImapClient->Settings->thread_limit;
|
||||
|
||||
$sSearchHash = '';
|
||||
|
@ -416,10 +417,11 @@ class MailClient
|
|||
$sSearchHash = 'ALL';
|
||||
}
|
||||
|
||||
$sSerializedHashKey = null;
|
||||
if ($oCacher && $oCacher->IsInited()) {
|
||||
$sSerializedHashKey =
|
||||
"ThreadsMapSorted/{$sSearchHash}/{$sFolderName}/{$sFolderHash}";
|
||||
// "ThreadsMapSorted/{$sSearchHash}/{$iThreadLimit}/{$sFolderName}/{$sFolderHash}";
|
||||
"ThreadsMapSorted/{$sSearchHash}/{$sFolderName}/{$oMessageCollection->FolderHash}";
|
||||
// "ThreadsMapSorted/{$sSearchHash}/{$iThreadLimit}/{$sFolderName}/{$oMessageCollection->FolderHash}";
|
||||
|
||||
if ($this->oLogger) {
|
||||
$this->oLogger->Write($sSerializedHashKey);
|
||||
|
@ -455,7 +457,7 @@ class MailClient
|
|||
unset($oException);
|
||||
}
|
||||
|
||||
if ($oCacher && $oCacher->IsInited() && !empty($sSerializedHashKey)) {
|
||||
if (!empty($sSerializedHashKey)) {
|
||||
$oCacher->Set($sSerializedHashKey, \json_encode(array(
|
||||
'ThreadsUids' => $aResult
|
||||
)));
|
||||
|
@ -695,7 +697,7 @@ class MailClient
|
|||
} else {
|
||||
$aUids = [];
|
||||
if ($bUseThreads) {
|
||||
$aAllThreads = $this->MessageListThreadsMap($oMessageCollection->FolderName, $oMessageCollection->FolderHash, $oParams->oCacher);
|
||||
$aAllThreads = $this->MessageListThreadsMap($oMessageCollection, $oParams->oCacher);
|
||||
$oMessageCollection->totalThreads = \count($aAllThreads);
|
||||
// $iThreadLimit = $this->oImapClient->Settings->thread_limit;
|
||||
if ($oParams->iThreadUid) {
|
||||
|
|
Loading…
Reference in a new issue