integrated attachment_common into the core
[squirrelmail.git] / src / move_messages.php
index bd87a9e0b7307d53eb9057ecfa82f60a798a0a1a..06707724e2decc8fe4dcf631cd7a3940999b7db0 100644 (file)
          //    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 (isset($msg[$i])) {
-               sqimap_messages_delete($imapConnection, $msg[$i], $msg[$i], $mailbox);
+               if (isset($markRead)) {
+                  sqimap_messages_flag($imapConnection, $msg[$i], $msg[$i], "Seen");
+               } else if (isset($markUnread)) {
+                   sqimap_messages_remove_flag($imapConnection, $msg[$i], $msg[$i], "Seen");
+               } else {
+                  sqimap_messages_delete($imapConnection, $msg[$i], $msg[$i], $mailbox);
+               }
                $j++;
             }
             $i++;
    sqimap_logout($imapConnection);
 
 ?>
-</BODY></HTML>
\ No newline at end of file
+</BODY></HTML>