Selaa lähdekoodia

Applied patch #102205 + some extra code to fix bug #121006.

pallo 24 vuotta sitten
vanhempi
commit
d55196673c

+ 3 - 3
functions/imap_mailbox.php

@@ -8,10 +8,10 @@
    /******************************************************************************
    /******************************************************************************
     **  Expunges a mailbox 
     **  Expunges a mailbox 
     ******************************************************************************/
     ******************************************************************************/
-   function sqimap_mailbox_expunge ($imap_stream, $mailbox) {
+   function sqimap_mailbox_expunge ($imap_stream, $mailbox,$handle_errors) {
       sqimap_mailbox_select ($imap_stream, $mailbox);
       sqimap_mailbox_select ($imap_stream, $mailbox);
       fputs ($imap_stream, "a001 EXPUNGE\r\n");
       fputs ($imap_stream, "a001 EXPUNGE\r\n");
-      $read = sqimap_read_data($imap_stream, "a001", true, $response, $message);
+      $read = sqimap_read_data($imap_stream, "a001", $handle_errors, $response, $message);
       sqimap_mailbox_close ($imap_stream);
       sqimap_mailbox_close ($imap_stream);
    }
    }
 
 
@@ -53,7 +53,7 @@
       }
       }
       if ($auto_expunge) {
       if ($auto_expunge) {
          fputs ($imap_stream, "a001 EXPUNGE\r\n");
          fputs ($imap_stream, "a001 EXPUNGE\r\n");
-         $tmp = sqimap_read_data($imap_stream, "a001", true, $a, $b);
+         $tmp = sqimap_read_data($imap_stream, "a001", false, $a, $b);
       }   
       }   
    }
    }
 
 

+ 1 - 1
functions/mailbox_display.php

@@ -107,7 +107,7 @@
       global $message_highlight_list;
       global $message_highlight_list;
       global $auto_expunge;
       global $auto_expunge;
 
 
-      sqimap_mailbox_expunge($imapConnection, $mailbox);
+      sqimap_mailbox_expunge($imapConnection, $mailbox, false);
       sqimap_mailbox_select($imapConnection, $mailbox);
       sqimap_mailbox_select($imapConnection, $mailbox);
 
 
       if (!$use_cache) {
       if (!$use_cache) {

+ 2 - 2
functions/tree.php

@@ -60,7 +60,7 @@
             if ($numMessages > 0) {
             if ($numMessages > 0) {
                sqimap_mailbox_select($imap_stream, $trash_folder);
                sqimap_mailbox_select($imap_stream, $trash_folder);
                sqimap_messages_flag ($imap_stream, 1, $numMessages, "Deleted");
                sqimap_messages_flag ($imap_stream, 1, $numMessages, "Deleted");
-               sqimap_mailbox_expunge($imap_stream, $trash_folder);
+               sqimap_mailbox_expunge($imap_stream, $trash_folder, true);
                sqimap_mailbox_close($imap_stream);
                sqimap_mailbox_close($imap_stream);
             }
             }
          }
          }
@@ -72,7 +72,7 @@
             if ($numMessages > 0) {
             if ($numMessages > 0) {
                sqimap_mailbox_select($imap_stream, $trash_folder);
                sqimap_mailbox_select($imap_stream, $trash_folder);
                sqimap_messages_flag ($imap_stream, 1, $numMessages, "Deleted");
                sqimap_messages_flag ($imap_stream, 1, $numMessages, "Deleted");
-               sqimap_mailbox_expunge($imap_stream, $trash_folder);
+               sqimap_mailbox_expunge($imap_stream, $trash_folder, true);
                sqimap_mailbox_close($imap_stream);
                sqimap_mailbox_close($imap_stream);
             }
             }
          }
          }

+ 1 - 1
src/delete_message.php

@@ -29,7 +29,7 @@
 
 
    sqimap_messages_delete($imapConnection, $message, $message, $mailbox);
    sqimap_messages_delete($imapConnection, $message, $message, $mailbox);
    if ($auto_expunge)
    if ($auto_expunge)
-      sqimap_mailbox_expunge($imapConnection, $mailbox);
+      sqimap_mailbox_expunge($imapConnection, $mailbox, true);
 
 
    $location = get_location();
    $location = get_location();
    if ($where && $what)
    if ($where && $what)

+ 3 - 3
src/move_messages.php

@@ -51,7 +51,7 @@
 
 
    // expunge-on-demand if user isn't using move_to_trash or auto_expunge
    // expunge-on-demand if user isn't using move_to_trash or auto_expunge
    if($expungeButton) {
    if($expungeButton) {
-     sqimap_mailbox_expunge($imapConnection, $mailbox);
+     sqimap_mailbox_expunge($imapConnection, $mailbox, true);
      $location = get_location();
      $location = get_location();
      if ($where && $what)
      if ($where && $what)
        header ("Location: $location/search.php?mailbox=".urlencode($mailbox)."&what=".urlencode($what)."&where=".urlencode($where));
        header ("Location: $location/search.php?mailbox=".urlencode($mailbox)."&what=".urlencode($what)."&where=".urlencode($where));
@@ -102,7 +102,7 @@
             $i++;
             $i++;
          }
          }
          if ($auto_expunge) {
          if ($auto_expunge) {
-            sqimap_mailbox_expunge($imapConnection, $mailbox);
+            sqimap_mailbox_expunge($imapConnection, $mailbox, true);
          }
          }
          $location = get_location();
          $location = get_location();
          if ($where && $what)
          if ($where && $what)
@@ -131,7 +131,7 @@
             $i++;
             $i++;
          }
          }
          if ($auto_expunge == true)
          if ($auto_expunge == true)
-            sqimap_mailbox_expunge($imapConnection, $mailbox);
+            sqimap_mailbox_expunge($imapConnection, $mailbox, true);
 
 
          $location = get_location();
          $location = get_location();
          if ($where && $what)
          if ($where && $what)