fix comp_in_new
[squirrelmail.git] / src / delete_message.php
index 966fc54838c6651300d7553a3bc5f37a501ec1cc..7cc08b1cf2924f7b340844f918c238d95f7493c8 100644 (file)
@@ -32,18 +32,20 @@ if (!isset($mail_sent)) {
 }
 
 $location = get_location();
+
 if (isset($where) && isset($what)) {
     header("Location: $location/search.php?where=" . urlencode($where) .
            '&what=' . urlencode($what) . '&mailbox=' . urlencode($mailbox));
 } else {
-    if ($compose_new_win == '1') {
+    if (!empty($saved_draft) || !empty($mail_sent)) {
           header("Location: $location/compose.php?mail_sent=$mail_sent&saved_draft=$saved_draft");
     }
     else {
-    header("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=" .
-           urlencode($mailbox));
+        header("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=" .
+               urlencode($mailbox));
     }
 }
 
 sqimap_logout($imapConnection);
+
 ?>