diff options
author | alecpl <alec@alec.pl> | 2010-03-31 07:14:32 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-03-31 07:14:32 +0000 |
commit | 6f31b356b2b21882b439324d233aceec413f4737 (patch) | |
tree | 6830ba38afe65f25ae34242d48a420011d10f67b /program/steps/mail | |
parent | 024f05762a66dde984785f868b8965905784072d (diff) |
- fix save/delete draft message with enabled threading (#1486596)
- performance improvement using UID SEARCH intead of SEARCH + FETCH
- re-fix r3445
Diffstat (limited to 'program/steps/mail')
-rw-r--r-- | program/steps/mail/sendmail.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index d6ef159dd..b89edc473 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -617,9 +617,9 @@ if ($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_once($CONFIG['drafts_mbox'], + 'HEADER Message-ID '.$olddraftmessageid, true); + $deleted = $IMAP->delete_message($a_deleteid, $CONFIG['drafts_mbox']); // raise error if deletion of old draft failed if (!$deleted) @@ -639,8 +639,8 @@ 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']); + $draftuids = $IMAP->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid, true); + $_SESSION['compose']['param']['_draft_uid'] = $draftuids[0]; // display success $OUTPUT->show_message('messagesaved', 'confirmation'); |