From: Marc G. K. <st...@us...> - 2003-09-18 17:57:23
|
Update of /cvsroot/squirrelmail/squirrelmail/functions In directory sc8-pr-cvs1:/tmp/cvs-serv20729 Modified Files: tree.php Log Message: CLOSE the selected mailbox (unselect) before we delete it. Thnx Julia Goolia for spotting this. Index: tree.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/functions/tree.php,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -r1.25 -r1.26 --- tree.php 31 Dec 2002 12:49:32 -0000 1.25 +++ tree.php 18 Sep 2003 17:57:13 -0000 1.26 @@ -72,7 +72,8 @@ $mbx_response = sqimap_mailbox_select($imap_stream, $trash_folder); if ($mbx_response['EXISTS'] > 0) { sqimap_messages_flag ($imap_stream, 1, '*', 'Deleted', true); - sqimap_mailbox_expunge($imap_stream, $trash_folder, true); + // CLOSE === EXPUNGE and UNSELECT + sqimap_run_command($imap_stream,'CLOSE',false,$response,$message); } } } else { @@ -82,7 +83,8 @@ $mbx_response = sqimap_mailbox_select($imap_stream, $trash_folder); if ($mbx_response['EXISTS'] > 0) { sqimap_messages_flag ($imap_stream, 1, '*', 'Deleted', true); - sqimap_mailbox_expunge($imap_stream, $trash_folder, true); + // CLOSE === EXPUNGE and UNSELECT + sqimap_run_command($imap_stream,'CLOSE',false,$response,$message); } } } @@ -110,16 +112,22 @@ sqimap_mailbox_create($imap_stream, $trash_folder . $delimiter . $subFolderName, ""); $mbx_response = sqimap_mailbox_select($imap_stream, $tree[$index]['value']); $messageCount = $mbx_response['EXISTS']; - if ($messageCount > 0) + if ($messageCount > 0) { sqimap_messages_copy($imap_stream, 1, '*', $trash_folder . $delimiter . $subFolderName); + } + // after copy close the mailbox to get in unselected state + sqimap_run_command($imap_stream,'CLOSE',false,$response,$message); for ($j = 0;$j < count($tree[$index]['subNodes']); $j++) walkTreeInPostOrderCreatingFoldersUnderTrash($tree[$index]['subNodes'][$j], $imap_stream, $tree, $topFolderName); } else { sqimap_mailbox_create($imap_stream, $trash_folder . $delimiter . $subFolderName, ''); $mbx_response = sqimap_mailbox_select($imap_stream, $tree[$index]['value']); $messageCount = $mbx_response['EXISTS']; - if ($messageCount > 0) + if ($messageCount > 0) { sqimap_messages_copy($imap_stream, 1, '*', $trash_folder . $delimiter . $subFolderName); + } + // after copy close the mailbox to get in unselected state + sqimap_run_command($imap_stream,'CLOSE',false,$response,$message); } } |