From: <ji...@us...> - 2007-03-28 01:22:25
|
Revision: 409 http://telaen.svn.sourceforge.net/telaen/?rev=409&view=rev Author: jimjag Date: 2007-03-27 18:21:25 -0700 (Tue, 27 Mar 2007) Log Message: ----------- Squash nasty little (and scary) bug where your Inbox appears to be totally cleaned out! Modified Paths: -------------- trunk/telaen/process.php Modified: trunk/telaen/process.php =================================================================== --- trunk/telaen/process.php 2007-03-27 19:19:39 UTC (rev 408) +++ trunk/telaen/process.php 2007-03-28 01:21:25 UTC (rev 409) @@ -26,6 +26,7 @@ $folder_key = base64_encode(strtolower($folder)); $folder_key_inbox = base64_encode("inbox"); $folder_key_spam = base64_encode("spam"); +$is_inbox_or_spam = ($folder_key == $folder_key_inbox || $folder_key == $folder_key_spam); if(!array_key_exists("headers",$sess)) $sess["headers"] = array(); @@ -54,7 +55,7 @@ $other_folder_key = $folder_key_inbox; } } - $messagecount = count($sess["headers"][$folder_key]); + $messagecount = count($headers); if(isset($start_pos) && isset($end_pos)) { $delarray = Array(); @@ -94,7 +95,7 @@ /* * Add the spamfolder if we have one. */ - if ($UM->_autospamfolder && ($folder_key == $folder_key_inbox || $folder_key == $folder_key_spam)) { + if ($UM->_autospamfolder && $is_inbox_or_spam) { $j = count($delarray); $othercount = count($sess["headers"][$other_folder_key]); for($i=0;$i<$othercount;$i++) { @@ -121,7 +122,7 @@ * our internal list does not match what we got on the server. */ if ($UM->mail_protocol == "pop3" && $expunge - && ($folder_key == $folder_key_inbox || $folder_key == $folder_key_spam)) { + && $is_inbox_or_spam) { if ($mail_use_forcedquit) { $UM->mail_disconnect_force(); @@ -168,7 +169,7 @@ $subtract++; unset ($sess["headers"][$folder_key][$ubiid]); } else { - if ($UM->_autospamfolder && ($folder_key == $folder_key_inbox || $folder_key == $folder_key_spam)) { + if ($UM->_autospamfolder && $is_inbox_or_spam) { $sess["headers"][$myfold][$ubiid]["msg"] -= $subtract; $sess["headers"][$myfold][$ubiid]["id"] -= $subtract; } else { @@ -200,7 +201,7 @@ $sess["headers"][$folder_key] = Array(); } - if ($UM->_autospamfolder && ($folder_key == $folder_key_inbox || $folder_key == $folder_key_spam)) { + if ($UM->_autospamfolder && $is_inbox_or_spam) { /* * Rebuild the folder array. */ @@ -230,7 +231,7 @@ */ unset ($sess["headers"][$folder_key]); $sess["headers"][$folder_key] = Array(); - if ($UM->_autospamfolder) { + if ($UM->_autospamfolder && $is_inbox_or_spam) { unset ($sess["headers"][$other_folder_key]); $sess["headers"][$other_folder_key] = Array(); } @@ -253,7 +254,7 @@ /* * If we deleted mails, the message list has already been reloaded. */ - if(!$expunge || ($folder_key != $folder_key_inbox && $folder_key != $folder_key_spam)) { + if(!$expunge || !$is_inbox_or_spam) { require("./get_message_list.php"); require("./apply_filters.php"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |