mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-10-04 10:54:21 +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\Net\Exceptions\*
|
||||||
* @throws \MailSo\Imap\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;
|
// $iThreadLimit = $this->oImapClient->Settings->thread_limit;
|
||||||
|
|
||||||
$sSearchHash = '';
|
$sSearchHash = '';
|
||||||
|
@ -416,10 +417,11 @@ class MailClient
|
||||||
$sSearchHash = 'ALL';
|
$sSearchHash = 'ALL';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sSerializedHashKey = null;
|
||||||
if ($oCacher && $oCacher->IsInited()) {
|
if ($oCacher && $oCacher->IsInited()) {
|
||||||
$sSerializedHashKey =
|
$sSerializedHashKey =
|
||||||
"ThreadsMapSorted/{$sSearchHash}/{$sFolderName}/{$sFolderHash}";
|
"ThreadsMapSorted/{$sSearchHash}/{$sFolderName}/{$oMessageCollection->FolderHash}";
|
||||||
// "ThreadsMapSorted/{$sSearchHash}/{$iThreadLimit}/{$sFolderName}/{$sFolderHash}";
|
// "ThreadsMapSorted/{$sSearchHash}/{$iThreadLimit}/{$sFolderName}/{$oMessageCollection->FolderHash}";
|
||||||
|
|
||||||
if ($this->oLogger) {
|
if ($this->oLogger) {
|
||||||
$this->oLogger->Write($sSerializedHashKey);
|
$this->oLogger->Write($sSerializedHashKey);
|
||||||
|
@ -455,7 +457,7 @@ class MailClient
|
||||||
unset($oException);
|
unset($oException);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($oCacher && $oCacher->IsInited() && !empty($sSerializedHashKey)) {
|
if (!empty($sSerializedHashKey)) {
|
||||||
$oCacher->Set($sSerializedHashKey, \json_encode(array(
|
$oCacher->Set($sSerializedHashKey, \json_encode(array(
|
||||||
'ThreadsUids' => $aResult
|
'ThreadsUids' => $aResult
|
||||||
)));
|
)));
|
||||||
|
@ -695,7 +697,7 @@ class MailClient
|
||||||
} else {
|
} else {
|
||||||
$aUids = [];
|
$aUids = [];
|
||||||
if ($bUseThreads) {
|
if ($bUseThreads) {
|
||||||
$aAllThreads = $this->MessageListThreadsMap($oMessageCollection->FolderName, $oMessageCollection->FolderHash, $oParams->oCacher);
|
$aAllThreads = $this->MessageListThreadsMap($oMessageCollection, $oParams->oCacher);
|
||||||
$oMessageCollection->totalThreads = \count($aAllThreads);
|
$oMessageCollection->totalThreads = \count($aAllThreads);
|
||||||
// $iThreadLimit = $this->oImapClient->Settings->thread_limit;
|
// $iThreadLimit = $this->oImapClient->Settings->thread_limit;
|
||||||
if ($oParams->iThreadUid) {
|
if ($oParams->iThreadUid) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue