Procházet zdrojové kódy

fixed problem with wrong messages getting deleted

Luke Ehresman před 25 roky
rodič
revize
326e29e174
3 změnil soubory, kde provedl 7 přidání a 6 odebrání
  1. 0 3
      functions/imap_messages.php
  2. 4 0
      src/folders_delete.php
  3. 3 3
      src/move_messages.php

+ 0 - 3
functions/imap_messages.php

@@ -9,7 +9,6 @@
     **  Copies specified messages to specified folder
     ******************************************************************************/
    function sqimap_messages_copy ($imap_stream, $start, $end, $mailbox) {
-      echo "a001 COPY $start:$end \"$mailbox\"\n<br>";
       fputs ($imap_stream, "a001 COPY $start:$end \"$mailbox\"\n");
       $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
    }
@@ -26,8 +25,6 @@
       } else {
          sqimap_messages_flag ($imap_stream, $start, $end, "Deleted");
       }
-      if ($auto_expunge == true)
-         sqimap_mailbox_expunge ($imap_stream, $mailbox);
    }
 
    /******************************************************************************

+ 4 - 0
src/folders_delete.php

@@ -58,6 +58,8 @@
 
             if ($success == true)
                sqimap_mailbox_delete($imapConnection, $boxes[$i]["unformatted"]);
+            if ($auto_expunge)
+               sqimap_mailbox_expunge($imapConnection, $mailbox);
          }
       }
    } else { /** if they do NOT wish to move messages to the trash (or cannot)**/
@@ -70,6 +72,8 @@
                sqimap_mailbox_delete($imapConnection, $boxes[$i]["unformatted"], $dm);
             }
          }
+         if ($auto_expunge)
+            sqimap_mailbox_expunge($imapConnection, $mailbox);
          fputs($imapConnection, "1 LIST \"$mailbox\" *\n");
          $data = sqimap_read_data($imapConnection , "1", false, $response, $message);
       }

+ 3 - 3
src/move_messages.php

@@ -52,12 +52,13 @@
          //    loop because we never increment j.  so check to see if msg[0] is set or not to fix this.
          while ($j < count($msg)) {
             if ($msg[$i]) {
-               echo $msg[$i] . "<BR>";
                sqimap_messages_delete($imapConnection, $msg[$i], $msg[$i], $mailbox);
                $j++;
             }
             $i++;
          }
+         if ($auto_expunge)
+            sqimap_mailbox_expunge($imapConnection, $mailbox);
          messages_deleted_message($mailbox, $sort, $startMessage, $color);
       } else {
          error_message(_("No messages were selected."), $mailbox, $sort, $startMessage, $color);
@@ -73,7 +74,6 @@
          //    loop because we never increment j.  so check to see if msg[0] is set or not to fix this.
          while ($j < count($msg)) {
             if ($msg[$i]) {
-               echo $msg[$i] . "<BR>";
                /** check if they would like to move it to the trash folder or not */
                sqimap_messages_copy($imapConnection, $msg[$i], $msg[$i], $targetMailbox);
                sqimap_messages_flag($imapConnection, $msg[$i], $msg[$i], "Deleted");
@@ -82,7 +82,7 @@
             $i++;
          }
          if ($auto_expunge == true)
-            sqimap_mailbox_expunge($imapConnection, $mailbox, $numMessages);
+            sqimap_mailbox_expunge($imapConnection, $mailbox);
 
          messages_moved_message($mailbox, $sort, $startMessage, $color);
       } else {