From 7c3e08025fc6ea6685d381953cb08e03f361eece Mon Sep 17 00:00:00 2001 From: tassium Date: Fri, 15 Aug 2003 14:46:15 +0000 Subject: [PATCH] sqimap_msgs_list_copy now does what you'd expect it to. sqimap_msgs_list_move does what _copy USED to do. Only one reference to that function needed to be changed in the core code. No core plugins use it. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5502 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 2 ++ functions/imap_messages.php | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2b33ad06..e6e2164a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -72,6 +72,8 @@ Version 1.5.0 -- CVS if IMAP connection dropped during login - Modified preference loading code to always have a complete $color array set in case a user uses an incomplete theme. + - new function sqimap_msgs_list_move() to replace sqimap_msgs_list_copy() + - sqimap_msgs_list_copy() no longer deletes messages copied. ************************************** diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 97b2812f..931ca036 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -20,11 +20,23 @@ function sqimap_messages_copy ($imap_stream, $start, $end, $mailbox) { $read = sqimap_run_command ($imap_stream, "COPY $start:$end " . sqimap_encode_mailbox_name($mailbox), true, $response, $message, $uid_support); } +/** +* copy a range of messages ($id) to another mailbox ($mailbox) +*/ function sqimap_msgs_list_copy ($imap_stream, $id, $mailbox) { global $uid_support; $msgs_id = sqimap_message_list_squisher($id); $read = sqimap_run_command ($imap_stream, "COPY $msgs_id " . sqimap_encode_mailbox_name($mailbox), true, $response, $message, $uid_support); - $read = sqimap_run_command ($imap_stream, "STORE $msgs_id +FLAGS (\\Deleted)", true, $response, $message, $uid_support); +} + +/** +* move a range of messages ($id) to another mailbox. Deletes the originals. +*/ +function sqimap_msgs_list_move ($imap_stream, $id, $mailbox) { + global $uid_support; + $msgs_id = sqimap_message_list_squisher($id); + $read = sqimap_run_command ($imap_stream, "COPY $msgs_id " . sqimap_encode_mailbox_name($mailbox), true, $response, $message, $uid_support); + $read = sqimap_run_command ($imap_stream, "STORE $msgs_id +FLAGS (\\Deleted)", true, $response,$message, $uid_support); } -- 2.25.1