thomascube
2006-06-27 ba8f44c4da7724f5e35866277e9775ec26616dc7
program/include/rcube_imap.inc
@@ -36,7 +36,7 @@
 *
 * @package    RoundCube Webmail
 * @author     Thomas Bruederli <roundcube@gmail.com>
 * @version    1.22
 * @version    1.26
 * @link       http://ilohamail.org
 */
class rcube_imap
@@ -989,7 +989,7 @@
  // append a mail message (source) to a specific mailbox
  function save_message($mbox_name, $message)
  function save_message($mbox_name, &$message)
    {
    $mailbox = $this->_mod_mailbox($mbox_name);
@@ -1261,9 +1261,30 @@
  // set a new name to an existing mailbox
  function rename_mailbox($mbox_name, $new_name)
  function rename_mailbox($mbox_name, $new_name, $subscribe=TRUE)
    {
    // not implemented yet
    $result = FALSE;
    // replace backslashes
    $name = preg_replace('/[\\\]+/', '-', $new_name);
    $name_enc = UTF7EncodeString($new_name);
    // reduce mailbox name to 100 chars
    $name_enc = substr($name_enc, 0, 100);
    $abs_name = $this->_mod_mailbox($name_enc);
    $a_mailbox_cache = $this->get_cache('mailboxes');
    if (strlen($abs_name) && (!is_array($a_mailbox_cache) || !in_array($abs_name, $a_mailbox_cache)))
      $result = iil_C_RenameFolder($this->conn, $mbox_name, $abs_name);
    // update mailboxlist cache
    if ($result && $subscribe)
      $this->unsubscribe($mbox_name);
      $this->subscribe($name_enc);
    return $result ? $name : FALSE;
    }
@@ -1693,8 +1714,13 @@
    
    return $str;
    }
  /**
   * Decode a mime-encoded string to internal charset
   *
   * @access static
   */
  function decode_mime_string($input)
    {
    $out = '';
@@ -1716,11 +1742,17 @@
      return $out;
      }
    else
      return $input;
    // no encoding information, defaults to what is specified in the class header
    return rcube_charset_convert($input, 'ISO-8859-1');
    }
  /**
   * Decode a part of a mime-encoded string
   *
   * @access static
   */
  function _decode_mime_string_part($str)
    {
    $a = explode('?', $str);
@@ -1793,8 +1825,10 @@
    if (is_array($ctype_param) && !empty($ctype_param['charset']))
      return rcube_charset_convert($body, $ctype_param['charset']);
    return $body;
    // defaults to what is specified in the class header
    return rcube_charset_convert($body,  'ISO-8859-1');
    }
@@ -1840,14 +1874,14 @@
    return array_merge($a_defaults, $a_out);
    }
  function get_id($uid)
  function get_id($uid, $mbox_name=NULL)
    {
      return $this->_uid2id($uid);
      return $this->_uid2id($uid, $mbox_name);
    }
  
  function get_uid($id)
  function get_uid($id,$mbox_name=NULL)
    {
      return $this->_id2uid($id);
      return $this->_id2uid($id, $mbox_name);
    }
  function _uid2id($uid, $mbox_name=NULL)
@@ -2086,4 +2120,4 @@
  return trim($output);
  }
?>
?>