From: Michael M Slusarz Date: Wed, 14 Oct 2009 18:14:32 +0000 (-0600) Subject: Fix case where caching might not be available X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b46b9b735467f0e3adc83c2faa9f05c6d6b71c02;p=horde.git Fix case where caching might not be available --- diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php index 4508e6eb4..78e533b6d 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php @@ -1409,7 +1409,9 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base } if (!empty($expunged)) { - $this->_cache->deleteMsgs($mailbox, $expunged); + if ($use_cache) { + $this->_cache->deleteMsgs($mailbox, $expunged); + } $tmp['mailbox']['messages'] -= $i; /* Update MODSEQ if active for mailbox. */ @@ -1460,6 +1462,8 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base * the tagged response. */ if (is_array($data[0])) { if (strtoupper(reset($data[0])) == 'EARLIER') { + /* Caching is guaranteed to be active if we are using + * QRESYNC. */ $this->_cache->deleteMsgs($this->_temp['mailbox']['name'], $this->utils->fromSequenceString($data[1])); } } else { @@ -2726,6 +2730,8 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base /* Get the list of flags from the cache. */ if (empty($options['replace'])) { + /* Caching is guaranteed to be active if CONDSTORE is + * active. */ $data = $this->_cache->get($this->_selected, array_keys($uids), array('HICflags'), $this->_temp['mailbox']['uidvalidity']); foreach ($uids as $uid => $modseq) {