Changeset 2448 in subversion
- Timestamp:
- May 2, 2009 3:19:39 PM (4 years ago)
- Location:
- trunk/roundcubemail/program
- Files:
-
- 2 edited
-
include/rcube_imap.php (modified) (7 diffs)
-
lib/imap.inc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap.php
r2436 r2448 1550 1550 { 1551 1551 $flag = strtoupper($flag); 1552 $msg_ids = array();1553 1552 if (!is_array($uids)) 1554 1553 $uids = explode(',',$uids); 1555 1554 1556 foreach ($uids as $uid) {1557 $msg_ids[$uid] = $this->_uid2id($uid);1558 }1559 1560 1555 if ($flag=='UNDELETED') 1561 $result = iil_C_Undelete($this->conn, $this->mailbox, join(',', array_values($msg_ids)));1556 $result = iil_C_Undelete($this->conn, $this->mailbox, join(',', $uids)); 1562 1557 else if ($flag=='UNSEEN') 1563 $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', array_values($msg_ids)));1558 $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', $uids)); 1564 1559 else if ($flag=='UNFLAGGED') 1565 $result = iil_C_UnFlag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), 'FLAGGED');1560 $result = iil_C_UnFlag($this->conn, $this->mailbox, join(',', $uids), 'FLAGGED'); 1566 1561 else 1567 $result = iil_C_Flag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), $flag);1562 $result = iil_C_Flag($this->conn, $this->mailbox, join(',', $uids), $flag); 1568 1563 1569 1564 // reload message headers if cached … … 1571 1566 if ($this->caching_enabled) 1572 1567 { 1573 foreach ($msg_ids as $uid => $id) 1574 { 1575 if ($cached_headers = $this->get_cached_message($cache_key, $uid)) 1568 foreach ($uids as $uid) 1569 { 1570 $id = $this->_uid2id($uid); 1571 if ($cached_headers = $this->get_cached_message($cache_key, $id)) 1576 1572 { 1577 1573 $this->remove_message_cache($cache_key, $id); … … 1586 1582 1587 1583 // set nr of messages that were flaged 1588 $count = count($ msg_ids);1584 $count = count($uids); 1589 1585 1590 1586 // clear message count cache … … 1651 1647 1652 1648 // exit if no message uids are specified 1653 if (!is_array($a_uids) )1649 if (!is_array($a_uids) || empty($a_uids)) 1654 1650 return false; 1655 1651 1656 // convert uids to message ids 1657 $a_mids = array(); 1658 foreach ($a_uids as $uid) 1659 $a_mids[] = $this->_uid2id($uid, $from_mbox); 1660 1661 $iil_move = iil_C_Move($this->conn, join(',', $a_mids), $from_mbox, $to_mbox); 1652 $iil_move = iil_C_Move($this->conn, join(',', $a_uids), $from_mbox, $to_mbox); 1662 1653 $moved = !($iil_move === false || $iil_move < 0); 1663 1654 … … 1675 1666 // moving failed 1676 1667 else if (rcmail::get_instance()->config->get('delete_always', false)) { 1677 return iil_C_Delete($this->conn, $from_mbox, join(',', $a_ mids));1668 return iil_C_Delete($this->conn, $from_mbox, join(',', $a_uids)); 1678 1669 } 1679 1670 1680 1671 // remove message ids from search set 1681 if ($moved && $this->search_set && $from_mbox == $this->mailbox) 1672 if ($moved && $this->search_set && $from_mbox == $this->mailbox) { 1673 foreach ($a_uids as $uid) 1674 $a_mids[] = $this->_uid2id($uid, $from_mbox); 1682 1675 $this->search_set = array_diff($this->search_set, $a_mids); 1683 1676 } 1684 1677 // update cached message headers 1685 1678 $cache_key = $from_mbox.'.msg'; … … 1716 1709 1717 1710 // exit if no message uids are specified 1718 if (!is_array($a_uids) )1711 if (!is_array($a_uids) || empty($a_uids)) 1719 1712 return false; 1720 1713 1721 // convert uids to message ids 1722 $a_mids = array(); 1723 foreach ($a_uids as $uid) 1724 $a_mids[] = $this->_uid2id($uid, $mailbox); 1725 1726 $deleted = iil_C_Delete($this->conn, $mailbox, join(',', $a_mids)); 1714 $deleted = iil_C_Delete($this->conn, $mailbox, join(',', $a_uids)); 1727 1715 1728 1716 // send expunge command in order to have the deleted message … … 1736 1724 1737 1725 // remove message ids from search set 1738 if ($deleted && $this->search_set && $mailbox == $this->mailbox) 1726 if ($deleted && $this->search_set && $mailbox == $this->mailbox) { 1727 foreach ($a_uids as $uid) 1728 $a_mids[] = $this->_uid2id($uid, $mailbox); 1739 1729 $this->search_set = array_diff($this->search_set, $a_mids); 1740 1730 } 1731 1741 1732 // remove deleted messages from cache 1742 1733 $cache_key = $mailbox.'.msg'; -
trunk/roundcubemail/program/lib/imap.inc
r2401 r2448 2081 2081 if (iil_C_Select($conn, $mailbox)) { 2082 2082 $c = 0; 2083 iil_PutLine($fp, "flg STORE $messages " . $mod . "FLAGS (" . $flag . ")");2083 iil_PutLine($fp, "flg UID STORE $messages " . $mod . "FLAGS (" . $flag . ")"); 2084 2084 do { 2085 2085 $line=chop(iil_ReadLine($fp, 100)); … … 2130 2130 $c=0; 2131 2131 2132 iil_PutLine($fp, "cpy1 COPY $messages \"".iil_Escape($to)."\"");2132 iil_PutLine($fp, "cpy1 UID COPY $messages \"".iil_Escape($to)."\""); 2133 2133 $line=iil_ReadReply($fp); 2134 2134 return iil_ParseResult($line); … … 2844 2844 $num_in_trash = iil_C_CountMessages($conn, $folder); 2845 2845 if ($num_in_trash > 0) { 2846 iil_C_Delete($conn, $folder, '1: ' . $num_in_trash);2846 iil_C_Delete($conn, $folder, '1:*'); 2847 2847 } 2848 2848 return (iil_C_Expunge($conn, $folder) >= 0);
Note: See TracChangeset
for help on using the changeset viewer.
