Selaa lähdekoodia

Also adapt the number of messages in a mailbox if the uidset is invalid.

stekkel 21 vuotta sitten
vanhempi
commit
f920eddada
1 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 5 3
      functions/mailbox_display.php

+ 5 - 3
functions/mailbox_display.php

@@ -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']) ?