From b46b9b735467f0e3adc83c2faa9f05c6d6b71c02 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 14 Oct 2009 12:14:32 -0600 Subject: [PATCH] Fix case where caching might not be available --- framework/Imap_Client/lib/Horde/Imap/Client/Socket.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) { -- 2.11.0