Bugfix: ETag should use account not ImapClient as switching accounts could generate same hash

This commit is contained in:
the-djmaze 2023-03-07 11:41:47 +01:00
parent e2ed87a1ab
commit 402de0d569
3 changed files with 4 additions and 4 deletions

View file

@ -65,7 +65,7 @@ trait Messages
// $oInfo = $this->MailClient()->FolderHash($oParams->sFolderName);
$oInfo = $this->ImapClient()->FolderStatusAndSelect($oParams->sFolderName);
$aRequestHash = \explode('-', $sHash);
$sFolderHash = $oInfo->getETag($this->ImapClient()->Hash());
$sFolderHash = $oInfo->getETag($this->getAccountFromToken()->IncLogin());
$sHash = $oParams->hash() . '-' . $sFolderHash;
if ($aRequestHash[1] == $sFolderHash) {
$this->verifyCacheByKey($sHash);
@ -429,7 +429,7 @@ trait Messages
}
if ($oMessage) {
$ETag = $oMessage->ETag($this->ImapClient()->Hash());
$ETag = $oMessage->ETag($this->getAccountFromToken()->IncLogin());
$this->verifyCacheByKey($ETag);
$this->Plugins()->RunHook('filter.result-message', array($oMessage));
$this->cacheByKey($ETag);