Pārlūkot izejas kodu

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.

tassium 22 gadi atpakaļ
vecāks
revīzija
759fc2745f
2 mainītis faili ar 15 papildinājumiem un 1 dzēšanām
  1. 2 0
      ChangeLog
  2. 13 1
      functions/imap_messages.php

+ 2 - 0
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.
   
 
 **************************************

+ 13 - 1
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);
 }