From: stekkel Date: Sun, 29 Jun 2003 19:27:27 +0000 (+0000) Subject: always check total messages for the trash_folder so we can show the putge X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1eb028a9522b8d49c6073f8267a7d642ae185088;p=squirrelmail.git always check total messages for the trash_folder so we can show the putge link if move_to_trash = true git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5167 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 5427bbe4..8717c49a 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -14,6 +14,15 @@ require_once(SM_PATH . 'functions/imap_utf7_local.php'); global $boxesnew; +/* + FIXME. This class should be extracted and placed in a separate file that + can be included before we start the session. That makes caching of the tree + possible. On a refresh mailboxes from left_main.php the only function that + should be called is the sqimap_get_status_mbx_tree. In case of subscribe + / rename / delete / new we have to create methods for adding/changing the + mailbox in the mbx_tree without the need for a refresh. +*/ + class mailboxes { var $mailboxname_full = '', $mailboxname_sub= '', $is_noselect = false, $is_special = false, $is_root = false, $is_inbox = false, $is_sent = false, @@ -929,7 +938,8 @@ function sqimap_get_status_mbx_tree($imap_stream,&$mbx_tree) { $oMbx =& $aMbxs[$i]; if (!$oMbx->is_noselect) { $mbx = $oMbx->mailboxname_full; - if ($unseen_type == 2) { + if ($unseen_type == 2 || + ($move_to_trash && $oMbx->mailboxname_full == $trash_folder)) { $query = "STATUS \"$mbx\" (MESSAGES UNSEEN)"; } else { $query = "STATUS \"$mbx\" (UNSEEN)"; @@ -965,7 +975,8 @@ function sqimap_get_status_mbx_tree($imap_stream,&$mbx_tree) { $oMbx =& $aMbxs[$i]; if (strtoupper($oMbx->mailboxname_full) == 'INBOX' || ($move_to_trash && $oMbx->mailboxname_full == $trash_folder)) { - if ($unseen_type == 2) { + if ($unseen_type == 2 || + ($oMbx->mailboxname_full == $trash_folder && $move_to_trash)) { $aStatus = sqimap_status_messages($imap_stream,$oMbx->mailboxname_full); $oMbx->unseen = $aStatus['UNSEEN']; $oMbx->total = $aStatus['MESSAGES'];