Also adapt the number of messages in a mailbox if the uidset is invalid.
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 2 Jun 2004 15:31:12 +0000 (15:31 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 2 Jun 2004 15:31:12 +0000 (15:31 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7587 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php

index 2e343f43b038a930549b870739260eaad18b2de2..eadabbc73bb5919d3f5eb7c2a4a6952933c59e92 100644 (file)
@@ -1911,7 +1911,7 @@ function handleMessageListForm($imapConnection,&$aMailbox,$sButton='',$aUid = ar
             foreach ($aUpdatedMsgs as $iUid => $aMsg) {
                 if (isset($aMsg['FLAGS'])) {
                     /**
-                     * Only update the cached headers if the header is 
+                     * Only update the cached headers if the header is
                      * cached.
                      */
                     if (isset($aMailbox['MSG_HEADERS'][$iUid])) {
@@ -1953,10 +1953,12 @@ function handleMessageListForm($imapConnection,&$aMailbox,$sButton='',$aUid = ar
                             unset($aMailbox['MSG_HEADERS'][$iUid]);
                         }
                         $aMailbox['UIDSET'][$aMailbox['SETINDEX']] = array_keys($aUidSetDummy);
-                        // update EXISTS info
-                        $aMailbox['EXISTS'] -= $iExpungedMessages;
                     }
                 }
+                // update EXISTS info
+                if ($iExpungedMessages) {
+                    $aMailbox['EXISTS'] -= (int) $iExpungedMessages;
+                }
                 // Change the startMessage number if the mailbox was changed
                 if (($aMailbox['PAGEOFFSET']+$iExpungedMessages-1) >= $aMailbox['EXISTS']) {
                     $aMailbox['PAGEOFFSET'] = ($aMailbox['PAGEOFFSET'] > $aMailbox['LIMIT']) ?