Changeset 5302 in subversion
- Timestamp:
- Oct 3, 2011 9:13:44 AM (20 months ago)
- Location:
- trunk/roundcubemail/program
- Files:
-
- 3 edited
-
include/rcube_imap.php (modified) (1 diff)
-
include/rcube_imap_generic.php (modified) (5 diffs)
-
steps/mail/sendmail.inc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap.php
r5297 r5302 2532 2532 * @param boolean $is_file True if $message is a filename 2533 2533 * 2534 * @return booleanTrue on success, False on error2534 * @return int|bool Appended message UID or True on success, False on error 2535 2535 */ 2536 2536 function save_message($mailbox, &$message, $headers='', $is_file=false) -
trunk/roundcubemail/program/include/rcube_imap_generic.php
r5240 r5302 311 311 else { 312 312 $this->resultcode = null; 313 // parse response for [APPENDUID 1204196876 3456] 314 if (preg_match("/^\[APPENDUID [0-9]+ ([0-9,:*]+)\]/i", $str, $m)) { 315 $this->data['APPENDUID'] = $m[1]; 316 } 313 317 } 314 318 $this->result = $str; … … 2499 2503 } 2500 2504 2505 /** 2506 * Handler for IMAP APPEND command 2507 * 2508 * @param string $mailbox Mailbox name 2509 * @param string $message Message content 2510 * 2511 * @return string|bool On success APPENDUID response (if available) or True, False on failure 2512 */ 2501 2513 function append($mailbox, &$message) 2502 2514 { 2515 unset($this->data['APPENDUID']); 2516 2503 2517 if (!$mailbox) { 2504 2518 return false; … … 2539 2553 unset($this->data['STATUS:'.$mailbox]); 2540 2554 2541 return ($this->parseResult($line, 'APPEND: ') == self::ERROR_OK); 2555 if ($this->parseResult($line, 'APPEND: ') != self::ERROR_OK) 2556 return false; 2557 else if (!empty($this->data['APPENDUID'])) 2558 return $this->data['APPENDUID']; 2559 else 2560 return true; 2542 2561 } 2543 2562 else { … … 2548 2567 } 2549 2568 2569 /** 2570 * Handler for IMAP APPEND command. 2571 * 2572 * @param string $mailbox Mailbox name 2573 * @param string $path Path to the file with message body 2574 * @param string $headers Message headers 2575 * 2576 * @return string|bool On success APPENDUID response (if available) or True, False on failure 2577 */ 2550 2578 function appendFromFile($mailbox, $path, $headers=null) 2551 2579 { 2580 unset($this->data['APPENDUID']); 2581 2552 2582 if (!$mailbox) { 2553 2583 return false; … … 2616 2646 unset($this->data['STATUS:'.$mailbox]); 2617 2647 2618 return ($this->parseResult($line, 'APPEND: ') == self::ERROR_OK); 2648 if ($this->parseResult($line, 'APPEND: ') != self::ERROR_OK) 2649 return false; 2650 else if (!empty($this->data['APPENDUID'])) 2651 return $this->data['APPENDUID']; 2652 else 2653 return true; 2619 2654 } 2620 2655 else { -
trunk/roundcubemail/program/steps/mail/sendmail.inc
r5301 r5302 625 625 if (!empty($CONFIG['sendmail_delay'])) 626 626 $RCMAIL->user->save_prefs(array('last_message_time' => time())); 627 627 628 628 // set replied/forwarded flag 629 629 if ($_SESSION['compose']['reply_uid']) … … 701 701 if ($olddraftmessageid) { 702 702 // delete previous saved draft 703 // @TODO: use message UID (remember to check UIDVALIDITY) to skip this SEARCH 703 704 $a_deleteid = $IMAP->search_once($CONFIG['drafts_mbox'], 704 705 'HEADER Message-ID '.$olddraftmessageid, true); … … 724 725 $msgid = strtr($message_id, array('>' => '', '<' => '')); 725 726 726 // remember new draft-uid 727 $draftuids = $IMAP->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid, true); 728 $_SESSION['compose']['param']['draft_uid'] = $draftuids[0]; 727 // remember new draft-uid ($saved could be an UID or TRUE here) 728 if (is_bool($saved)) { 729 $draftuids = $IMAP->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid, true); 730 $saved = $draftuids[0]; 731 } 732 $_SESSION['compose']['param']['draft_uid'] = $saved; 729 733 730 734 // display success
Note: See TracChangeset
for help on using the changeset viewer.
