thomascube
2012-02-27 9efa95ea9b51cec0a12502455e9c27e64e3aae14
program/steps/mail/sendmail.inc
@@ -6,7 +6,10 @@
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2011, The Roundcube Dev Team                       |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
 | See the README file for a full license statement.                     |
 |                                                                       |
 | PURPOSE:                                                              |
 |   Compose a new mail message with all headers and attachments         |
@@ -711,7 +714,7 @@
    $delete_idx = $RCMAIL->storage->search_once($CONFIG['drafts_mbox'],
        'HEADER Message-ID '.$olddraftmessageid);
    if ($del_uid = $delete_idx->getElement('FIRST')) {
    if ($del_uid = $delete_idx->get_element('FIRST')) {
      $deleted = $RCMAIL->storage->delete_message($del_uid, $CONFIG['drafts_mbox']);
      // raise error if deletion of old draft failed
@@ -734,12 +737,13 @@
  // remember new draft-uid ($saved could be an UID or TRUE here)
  if (is_bool($saved)) {
    $draft_idx = $RCMAIL->storage->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid);
    $saved     = $draft_idx->getElement('FIRST');
    $saved     = $draft_idx->get_element('FIRST');
  }
  $COMPOSE['param']['draft_uid'] = $saved;
  $plugin = $RCMAIL->plugins->exec_hook('message_draftsaved', array('msgid' => $msgid, 'uid' => $saved, 'folder' => $store_target));
  // display success
  $OUTPUT->show_message('messagesaved', 'confirmation');
  $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'messagesaved', 'confirmation');
  // update "_draft_saveid" and the "cmp_hash" to prevent "Unsaved changes" warning
  $OUTPUT->command('set_draft_id', $msgid);