From: Marc G. K. <st...@us...> - 2002-08-19 07:39:15
|
Update of /cvsroot/squirrelmail/squirrelmail/functions In directory usw-pr-cvs1:/tmp/cvs-serv14239 Modified Files: tree.php Log Message: fix for bug #596781 Index: tree.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/functions/tree.php,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -r1.22 -r1.23 --- tree.php 8 Aug 2002 18:54:28 -0000 1.22 +++ tree.php 19 Aug 2002 07:39:09 -0000 1.23 @@ -69,10 +69,9 @@ if ($tree[$index]['value'] != $trash_folder) { sqimap_mailbox_delete($imap_stream, $tree[$index]['value']); } else { - $numMessages = sqimap_get_num_messages($imap_stream, $trash_folder); - if ($numMessages > 0) { - sqimap_mailbox_select($imap_stream, $trash_folder); - sqimap_messages_flag ($imap_stream, 1, $numMessages, 'Deleted', true); + $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); } } @@ -80,16 +79,16 @@ if ($tree[$index]['value'] != $trash_folder) { sqimap_mailbox_delete($imap_stream, $tree[$index]['value']); } else { - $numMessages = sqimap_get_num_messages($imap_stream, $trash_folder); - if ($numMessages > 0) { - sqimap_mailbox_select($imap_stream, $trash_folder); - sqimap_messages_flag ($imap_stream, 1, $numMessages, 'Deleted', true); + $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); } } } } + function walkTreeInPreOrderDeleteFolders($index, $imap_stream, $tree) { if ($tree[$index]['doIHaveChildren']) { for ($j = 0; $j < count($tree[$index]['subNodes']); $j++) { @@ -109,21 +108,18 @@ if ($tree[$index]['doIHaveChildren']) { sqimap_mailbox_create($imap_stream, $trash_folder . $delimiter . $subFolderName, ""); - sqimap_mailbox_select($imap_stream, $tree[$index]['value']); - - $messageCount = sqimap_get_num_messages($imap_stream, $tree[$index]['value']); + $mbx_response = sqimap_mailbox_select($imap_stream, $tree[$index]['value']); + $messageCount = $mbx_response['EXISTS']; if ($messageCount > 0) - sqimap_messages_copy($imap_stream, 1, $messageCount, $trash_folder . $delimiter . $subFolderName); - + sqimap_messages_copy($imap_stream, 1, '*', $trash_folder . $delimiter . $subFolderName); 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, ''); - sqimap_mailbox_select($imap_stream, $tree[$index]['value']); - - $messageCount = sqimap_get_num_messages($imap_stream, $tree[$index]['value']); + $mbx_response = sqimap_mailbox_select($imap_stream, $tree[$index]['value']); + $messageCount = $mbx_response['EXISTS']; if ($messageCount > 0) - sqimap_messages_copy($imap_stream, 1, $messageCount, $trash_folder . $delimiter . $subFolderName); + sqimap_messages_copy($imap_stream, 1, '*', $trash_folder . $delimiter . $subFolderName); } } |