diff options
author | thomascube <thomas@roundcube.net> | 2008-06-20 10:40:01 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-06-20 10:40:01 +0000 |
commit | c719f3c1e06c00fa4723f2f1298b3c94a1bec7e7 (patch) | |
tree | b343f67ba679e5761c6b27e2cb398de0e6a83a2d /program/steps/mail/sendmail.inc | |
parent | 4e59f63323341b546eaf0dddbb23f38128d7fb14 (diff) |
Store compose parameters in session and redirect to a unique URL
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r-- | program/steps/mail/sendmail.inc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 1da2fc05b..44f2bdf6c 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -387,8 +387,8 @@ if ($CONFIG[$store_target]) if ($olddraftmessageid) { // delete previous saved draft - $a_deleteid = $IMAP->search($CONFIG['drafts_mbox'],'HEADER Message-ID',$olddraftmessageid); - $deleted = $IMAP->delete_message($IMAP->get_uid($a_deleteid[0],$CONFIG['drafts_mbox']),$CONFIG['drafts_mbox']); + $a_deleteid = $IMAP->search($CONFIG['drafts_mbox'], 'HEADER Message-ID', $olddraftmessageid); + $deleted = $IMAP->delete_message($IMAP->get_uid($a_deleteid[0], $CONFIG['drafts_mbox']), $CONFIG['drafts_mbox']); // raise error if deletion of old draft failed if (!$deleted) @@ -399,11 +399,17 @@ if ($CONFIG[$store_target]) if ($savedraft) { + $msgid = strtr($message_id, array('>' => '', '<' => '')); + + // remember new draft-uid + $draftids = $IMAP->search($CONFIG['drafts_mbox'], 'HEADER Message-ID', $msgid); + $_SESSION['compose']['param']['_draft_uid'] = $IMAP->get_uid($draftids[0], $CONFIG['drafts_mbox']); + // display success $OUTPUT->show_message('messagesaved', 'confirmation'); // update "_draft_saveid" and the "cmp_hash" to prevent "Unsaved changes" warning - $OUTPUT->command('set_draft_id', str_replace(array('<','>'), "", $message_id)); + $OUTPUT->command('set_draft_id', $msgid); $OUTPUT->command('compose_field_hash', true); // start the auto-save timer again |