From c78a652746fde91ec6c713cdbaf368437d63e2e3 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 02 Jul 2013 09:51:22 -0400
Subject: [PATCH] Don't clear References and in-Reply-To when a message is "edited as new" (#1489216)

---
 CHANGELOG                      |    1 +
 program/steps/mail/compose.inc |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index f001417..2f5721e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Don't clear References and in-Reply-To when a message is "edited as new" (#1489216)
 - Fix messages list sorting with THREAD=REFS
 - Remove deprecated (in PHP 5.5) PREG /e modifier usage (#1489174)
 - Fix empty messages list when register_globals is enabled (#1489157)
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 9e1b727..85fa712 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -210,8 +210,8 @@
       $COMPOSE['param']['sent_mbox'] = $sent_folder;
     }
   }
-  else if ($compose_mode == RCUBE_COMPOSE_DRAFT) {
-    if ($draft_info = $MESSAGE->headers->get('x-draft-info')) {
+  else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) {
+    if ($compose_mode == RCUBE_COMPOSE_DRAFT && ($draft_info = $MESSAGE->headers->get('x-draft-info'))) {
       // get reply_uid/forward_uid to flag the original message when sending
       $info = rcmail_draftinfo_decode($draft_info);
 
@@ -233,7 +233,7 @@
     if ($in_reply_to = $MESSAGE->headers->get('in-reply-to'))
       $COMPOSE['reply_msgid'] = '<' . $in_reply_to . '>';
 
-    $COMPOSE['references']  = $MESSAGE->headers->references;
+    $COMPOSE['references'] = $MESSAGE->headers->references;
   }
 }
 else {

--
Gitblit v1.9.1