correctly check for messages in trash if the total is set, but is empty (since
authorebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 7 May 2005 21:28:09 +0000 (21:28 +0000)
committerebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 7 May 2005 21:28:09 +0000 (21:28 +0000)
that does not necessarily mean there aren't any messages in the trash..)

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9408 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/left_main.php

index 1272053f74bbab0d948a52ad6349b67272f2f18e..272e8338cc39819f8f82ca9e4147327aa2c047e6 100644 (file)
@@ -120,9 +120,13 @@ function ListBoxes ($boxes, $j=0 ) {
 
     /* If there are unseen message, bold the line. */
     if (($move_to_trash) && ($mailbox == $trash_folder)) {
-        if (! isset($boxes->total)) {
-            $boxes->total = sqimap_status_messages($imapConnection, $mailbox);
+
+        if ( !is_numeric($boxes->total) ) {
+            $result = sqimap_status_messages($imapConnection, $mailbox);
+            $boxes->total = $result['MESSAGES'];
+            $boxes->unseen = $result['UNSEEN'];
         }
+        
         $pre .= "<a href=\"right_main.php?PG_SHOWALL=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\">";
         if ($unseen > 0) {
             $pre .= '<b>';
@@ -134,7 +138,7 @@ function ListBoxes ($boxes, $j=0 ) {
             if ($unseen_found) {
                 $end .= "&nbsp;<small>$unseen_string</small>";
             }
-            $end .= "\n\t<small>" .
+            $end .= "\n<small>" .
                  '&nbsp;&nbsp;[<a href="empty_trash.php">'._("Purge").'</a>]'.
                  '</small>';
         }