Changeset 2540 in subversion


Ignore:
Timestamp:
May 26, 2009 4:50:10 AM (4 years ago)
Author:
alec
Message:
  • Support UID EXPUNGE: remove only moved/deleted messages
Location:
trunk/roundcubemail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r2538 r2540  
    22=========================== 
    33 
     4- Support UID EXPUNGE: remove only moved/deleted messages 
    45- Add drag cancelling with ESC key (#1484344) 
    56- Support initial identity name from virtuser_query (#1484003) 
  • trunk/roundcubemail/program/include/rcube_imap.php

    r2505 r2540  
    16301630      if (!rcmail::get_instance()->config->get('flag_for_deletion', false)) 
    16311631        { 
    1632         $this->_expunge($from_mbox, FALSE); 
     1632        $this->_expunge($from_mbox, FALSE, $a_uids); 
    16331633        $this->_clear_messagecount($from_mbox); 
    16341634        $this->_clear_messagecount($to_mbox); 
     
    16891689    if ($deleted) 
    16901690      { 
    1691       $this->_expunge($mailbox, FALSE); 
     1691      $this->_expunge($mailbox, FALSE, $a_uids); 
    16921692      $this->_clear_messagecount($mailbox); 
    16931693      unset($this->uid_id_map[$mailbox]); 
     
    17691769   * 
    17701770   * @see rcube_imap::expunge() 
    1771    * @access private 
    1772    */ 
    1773   function _expunge($mailbox, $clear_cache=TRUE) 
    1774     { 
    1775     $result = iil_C_Expunge($this->conn, $mailbox); 
     1771   * @param string      Mailbox name 
     1772   * @param boolean     False if cache should not be cleared 
     1773   * @param string      List of UIDs to remove, separated by comma 
     1774   * @return boolean True on success 
     1775   * @access private 
     1776   */ 
     1777  function _expunge($mailbox, $clear_cache=TRUE, $uids=NULL) 
     1778    { 
     1779    if ($uids && $this->get_capability('UIDPLUS'))  
     1780      $a_uids = is_array($uids) ? join(',', $uids) : $uids; 
     1781    else 
     1782      $a_uids = NULL; 
     1783 
     1784    $result = iil_C_Expunge($this->conn, $mailbox, $a_uids); 
    17761785 
    17771786    if ($result>=0 && $clear_cache) 
  • trunk/roundcubemail/program/lib/imap.inc

    r2533 r2540  
    8383                - removed caching functions 
    8484                - handling connection startup response 
     85                - added UID EXPUNGE support 
    8586 
    8687********************************************************/ 
     
    18641865} 
    18651866 
    1866 function iil_C_Expunge(&$conn, $mailbox) { 
     1867function iil_C_Expunge(&$conn, $mailbox, $messages=NULL) { 
    18671868 
    18681869        if (iil_C_Select($conn, $mailbox)) { 
    18691870                $c = 0; 
    1870                 iil_PutLine($conn->fp, "exp1 EXPUNGE"); 
     1871                $command = $messages ? "UID EXPUNGE $messages" : "EXPUNGE"; 
     1872 
     1873                iil_PutLine($conn->fp, "exp1 $command"); 
    18711874                do { 
    18721875                        $line=chop(iil_ReadLine($conn->fp, 100)); 
     
    20312034 
    20322035function iil_C_Move(&$conn, $messages, $from, $to) { 
    2033     $fp = $conn->fp; 
    20342036 
    20352037    if (!$from || !$to) { 
    20362038        return -1; 
    20372039    } 
    2038     $r = iil_C_Copy($conn, $messages, $from,$to); 
     2040     
     2041    $r = iil_C_Copy($conn, $messages, $from, $to); 
     2042 
    20392043    if ($r==0) { 
    20402044        return iil_C_Delete($conn, $from, $messages); 
Note: See TracChangeset for help on using the changeset viewer.