Add option to folder prefs for marking deleted messages as read
[squirrelmail.git] / functions / imap_messages.php
index f16abe8596c53fa5bb0f528b36f5cc615448203b..2b24604692e4dadb642020aa244bcc29390d969b 100755 (executable)
@@ -68,7 +68,9 @@ function sqimap_msgs_list_move($imap_stream, $id, $mailbox, $handle_errors = tru
  */
 function sqimap_msgs_list_delete($imap_stream, $mailbox, $id, $bypass_trash=false) {
     // FIXME: Remove globals by introducing an associative array with properties as 4th argument as replacement for the $bypass_trash variable.
-    global $move_to_trash, $trash_folder;
+    global $move_to_trash, $trash_folder, $mark_as_read_upon_delete;
+    if ($mark_as_read_upon_delete)
+        sqimap_toggle_flag($imap_stream, $id, '\\Seen', true, true);
     if (($move_to_trash == true) && ($bypass_trash != true) &&
         (sqimap_mailbox_exists($imap_stream, $trash_folder) &&  ($mailbox != $trash_folder)) ) {
         /**