Fix draft removal after a message is sent and storing sent message is disabled (#1490467)

pull/289/head
Aleksander Machniak 9 years ago
parent 1ce32a4622
commit 8b0d817919

@ -28,6 +28,7 @@ CHANGELOG Roundcube Webmail
- Fix multi-folder search result sorting by arrival date (#1490450) - Fix multi-folder search result sorting by arrival date (#1490450)
- Fix so *-request@ addresses in Sender: header are also ignored on reply-all (#1490452) - Fix so *-request@ addresses in Sender: header are also ignored on reply-all (#1490452)
- Update to TinyMCE 4.1.10 (#1490405) - Update to TinyMCE 4.1.10 (#1490405)
- Fix draft removal after a message is sent and storing sent message is disabled (#1490467)
RELEASE 1.1.2 RELEASE 1.1.2
------------- -------------

@ -640,24 +640,24 @@ if ($store_target) {
$OUTPUT->send('iframe'); $OUTPUT->send('iframe');
} }
} }
// delete previous saved draft
if ($saved && ($old_id = rcube_utils::get_input_value('_draft_saveid', rcube_utils::INPUT_POST))) {
$deleted = $RCMAIL->storage->delete_message($old_id, $drafts_mbox);
// raise error if deletion of old draft failed
if (!$deleted) {
rcube::raise_error(array('code' => 800, 'type' => 'imap',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Could not delete message from $drafts_mbox"), true, false);
}
}
} }
// remove temp file // remove temp file
else if ($mailbody_file) { else if ($mailbody_file) {
unlink($mailbody_file); unlink($mailbody_file);
} }
// delete previous saved draft
$old_id = rcube_utils::get_input_value('_draft_saveid', rcube_utils::INPUT_POST);
if ($old_id && ($sent || $saved)) {
$deleted = $RCMAIL->storage->delete_message($old_id, $drafts_mbox);
// raise error if deletion of old draft failed
if (!$deleted) {
rcube::raise_error(array('code' => 800, 'type' => 'imap',
'file' => __FILE__, 'line' => __LINE__,
'message' => "Could not delete message from $drafts_mbox"), true, false);
}
}
if ($savedraft) { if ($savedraft) {
// remember new draft-uid ($saved could be an UID or true/false here) // remember new draft-uid ($saved could be an UID or true/false here)

Loading…
Cancel
Save