| | |
| | | |
| | | if ($olddraftmessageid) { |
| | | // delete previous saved draft |
| | | // @TODO: use message UID (remember to check UIDVALIDITY) to skip this SEARCH |
| | | $a_deleteid = $IMAP->search_once($CONFIG['drafts_mbox'], |
| | | 'HEADER Message-ID '.$olddraftmessageid, true); |
| | | |
| | |
| | | if ($savedraft) { |
| | | $msgid = strtr($message_id, array('>' => '', '<' => '')); |
| | | |
| | | // remember new draft-uid |
| | | // remember new draft-uid ($saved could be an UID or TRUE here) |
| | | if (is_bool($saved)) { |
| | | $draftuids = $IMAP->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid, true); |
| | | $_SESSION['compose']['param']['draft_uid'] = $draftuids[0]; |
| | | $saved = $draftuids[0]; |
| | | } |
| | | $_SESSION['compose']['param']['draft_uid'] = $saved; |
| | | |
| | | // display success |
| | | $OUTPUT->show_message('messagesaved', 'confirmation'); |