summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-01-27 17:44:46 +0100
committerThomas Bruederli <thomas@roundcube.net>2014-01-27 17:44:46 +0100
commit90dc9b15125b60c000e10006a6b95ad72952ae9e (patch)
tree020c625587b2e77ea4764462091c8f2a0575f633
parent3509a8e5f8279de109007c0d975e36ffec1581d8 (diff)
Compare message IDs before suggesting to restore compose messages on reply
-rw-r--r--program/js/app.js11
-rw-r--r--program/steps/mail/compose.inc3
2 files changed, 13 insertions, 1 deletions
diff --git a/program/js/app.js b/program/js/app.js
index f83caeb36..f4a41e7f4 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3141,6 +3141,10 @@ function rcube_webmail()
if (this.env.draft_id && formdata.draft_id && formdata.draft_id != this.env.draft_id) {
continue;
}
+ // skip records on reply
+ if (this.env.reply_msgid && formdata.reply_msgid != this.env.reply_msgid) {
+ continue;
+ }
// show dialog asking to restore the message
if (formdata.changed && formdata.session != this.env.session_id) {
this.show_popup_dialog(
@@ -3616,8 +3620,10 @@ function rcube_webmail()
this.env.draft_id = id;
$("input[name='_draft_saveid']").val(id);
- this.remove_compose_data(this.env.compose_id);
}
+
+ // always remove local copy upon saving as draft
+ this.remove_compose_data(this.env.compose_id);
};
this.auto_save_start = function()
@@ -3681,6 +3687,9 @@ function rcube_webmail()
if (this.env.draft_id) {
formdata.draft_id = this.env.draft_id;
}
+ if (this.env.reply_msgid) {
+ formdata.reply_msgid = this.env.reply_msgid;
+ }
$('input, select, textarea', this.gui_objects.messageform).each(function(i, elem) {
switch (elem.tagName.toLowerCase()) {
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index db001d54e..6e478c656 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -271,6 +271,9 @@ else {
}
}
+if (!empty($COMPOSE['reply_msgid']))
+ $OUTPUT->set_env('reply_msgid', $COMPOSE['reply_msgid']);
+
$MESSAGE->compose = array();
// get user's identities