thomascube
2007-04-28 f1154163b0a9efb21d722bc658352739040ffd61
program/include/rcube_imap.inc
@@ -1373,7 +1373,8 @@
    foreach ($a_uids as $uid)
      $a_mids[] = $this->_uid2id($uid, $from_mbox);
    $moved = iil_C_Move($this->conn, join(',', $a_mids), $from_mbox, $to_mbox);
    $iil_move = iil_C_Move($this->conn, join(',', $a_mids), $from_mbox, $to_mbox);
    $moved = !($iil_move === false || $iil_move < 0);
    
    // send expunge command in order to have the moved message
    // really deleted from the source mailbox
@@ -1721,6 +1722,10 @@
          $this->create_mailbox($folder, TRUE);
        else
          $this->subscribe($folder);
        }
      else if (!in_array_nocase($abs_name, $a_folders))
        {
        $this->create_mailbox($folder, FALSE);
        }
      }
    }
@@ -2102,9 +2107,9 @@
   * --------------------------------*/
  
  function decode_address_list($input, $max=NULL)
  function decode_address_list($input, $max=null, $decode=true)
    {
    $a = $this->_parse_address_list($input);
    $a = $this->_parse_address_list($input, $decode);
    $out = array();
    
    if (!is_array($a))
@@ -2141,9 +2146,7 @@
    {
    $str = $this->decode_mime_string((string)$input);
    if ($str{0}=='"' && $remove_quotes)
      {
      $str = str_replace('"', '', $str);
      }
    
    return $str;
    }
@@ -2154,7 +2157,7 @@
   *
   * @access static
   */
  function decode_mime_string($input, $recursive=false)
  function decode_mime_string($input, $fallback=null)
    {
    $out = '';
@@ -2171,13 +2174,13 @@
      $rest = substr($input, $end_pos+2);
      $out .= rcube_imap::_decode_mime_string_part($encstr);
      $out .= rcube_imap::decode_mime_string($rest);
      $out .= rcube_imap::decode_mime_string($rest, $fallback);
      return $out;
      }
      
    // no encoding information, defaults to what is specified in the class header
    return rcube_charset_convert($input, 'ISO-8859-1');
    // no encoding information, use fallback
    return rcube_charset_convert($input, !empty($fallback) ? $fallback : 'ISO-8859-1');
    }
@@ -2272,7 +2275,7 @@
  function _mod_mailbox($mbox_name, $mode='in')
    {
    if ((!empty($this->root_ns) && $this->root_ns == $mbox_name) || $mbox_name == 'INBOX')
    if (empty($mbox_name) || (!empty($this->root_ns) && $this->root_ns == $mbox_name) || $mbox_name == 'INBOX')
      return $mbox_name;
    if (!empty($this->root_dir) && $mode=='in') 
@@ -2309,12 +2312,12 @@
  function get_id($uid, $mbox_name=NULL) 
    {
      return $this->_uid2id($uid, $mbox_name);
      return $this->_uid2id($uid, $this->_mod_mailbox($mbox_name));
    }
  
  function get_uid($id,$mbox_name=NULL)
    {
      return $this->_id2uid($id, $mbox_name);
      return $this->_id2uid($id, $this->_mod_mailbox($mbox_name));
    }
  function _uid2id($uid, $mbox_name=NULL)
@@ -2468,7 +2471,7 @@
    }
  function _parse_address_list($str)
  function _parse_address_list($str, $decode=true)
    {
    // remove any newlines and carriage returns before
    $a = $this->_explode_quoted_string('[,;]', preg_replace( "/[\r\n]/", " ", $str));
@@ -2477,7 +2480,7 @@
    foreach ($a as $key => $val)
      {
      $val = preg_replace("/([\"\w])</", "$1 <", $val);
      $sub_a = $this->_explode_quoted_string(' ', $this->decode_header($val));
      $sub_a = $this->_explode_quoted_string(' ', $decode ? $this->decode_header($val) : $val);
      $result[$key]['name'] = '';
      foreach ($sub_a as $k => $v)