Update deleted message count if not using cache.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 4 Dec 2008 19:49:31 +0000 (12:49 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 4 Dec 2008 19:53:13 +0000 (12:53 -0700)
framework/Imap_Client/lib/Horde/Imap/Client/Socket.php

index 15df600..98b4ce0 100644 (file)
@@ -1359,7 +1359,6 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
                 $expunged = array();
                 $i = 0;
                 $t = $s_res['sort'];
-
                 foreach ($tmp['expunge'] as $val) {
                     $expunged[] = $t[$val - 1 + $i++];
                 }
@@ -1373,6 +1372,9 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
             if (isset($this->_init['enabled']['QRESYNC'])) {
                 $this->_cacheOb->setMetaData($mailbox, array('HICmodseq' => $this->_temp['mailbox']['highestmodseq']));
             }
+        } elseif (!empty($tmp['expunge'])) {
+            /* Updates status message count if not using cache. */
+            $tmp['mailbox']['messages'] -= count($tmp['expunge']);
         }
     }