Changeset 2253 in subversion


Ignore:
Timestamp:
Jan 22, 2009 9:49:50 AM (4 years ago)
Author:
alec
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_imap.php

    r2251 r2253  
    15051505   * @param mixed  Message UIDs as array or as comma-separated string 
    15061506   * @param string Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT, MDNSENT 
    1507    * @param boolean Simulate flagging (don't set flag on IMAP server) 
    15081507   * @return boolean True on success, False on failure 
    15091508   */ 
    1510   function set_flag($uids, $flag, $fake=false) 
     1509  function set_flag($uids, $flag) 
    15111510    { 
    15121511    $flag = strtoupper($flag); 
     
    15151514      $uids = explode(',',$uids); 
    15161515       
    1517     if (!$fake || $this->caching_enabled) 
    1518       foreach ($uids as $uid) { 
    1519         $msg_ids[$uid] = $this->_uid2id($uid); 
    1520       } 
    1521      
    1522     if (!$fake) { 
    1523       if ($flag=='UNDELETED') 
    1524         $result = iil_C_Undelete($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 
    1525       else if ($flag=='UNSEEN') 
    1526         $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 
    1527       else if ($flag=='UNFLAGGED') 
    1528         $result = iil_C_UnFlag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), 'FLAGGED'); 
    1529       else 
    1530         $result = iil_C_Flag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), $flag); 
    1531       } 
    1532      
     1516    foreach ($uids as $uid) { 
     1517      $msg_ids[$uid] = $this->_uid2id($uid); 
     1518    } 
     1519       
     1520    if ($flag=='UNDELETED') 
     1521      $result = iil_C_Undelete($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 
     1522    else if ($flag=='UNSEEN') 
     1523      $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', array_values($msg_ids))); 
     1524    else if ($flag=='UNFLAGGED') 
     1525      $result = iil_C_UnFlag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), 'FLAGGED'); 
     1526    else 
     1527      $result = iil_C_Flag($this->conn, $this->mailbox, join(',', array_values($msg_ids)), $flag); 
     1528 
    15331529    // reload message headers if cached 
    1534     if ($this->caching_enabled) { 
    1535       $cache_key = $this->mailbox.'.msg'; 
    1536       foreach ($msg_ids as $uid => $id) { 
     1530    $cache_key = $this->mailbox.'.msg'; 
     1531    if ($this->caching_enabled) 
     1532      { 
     1533      foreach ($msg_ids as $uid => $id) 
     1534        { 
    15371535        if ($cached_headers = $this->get_cached_message($cache_key, $uid)) 
    15381536          { 
     
    15481546 
    15491547    // set nr of messages that were flaged 
    1550     $count = count($uids); 
     1548    $count = count($msg_ids); 
    15511549 
    15521550    // clear message count cache 
     
    29412939         
    29422940      if (empty($result[$key]['name'])) 
    2943         $result[$key]['name'] = $result[$key]['address']; 
    2944       elseif (empty($result[$key]['address']))  
    2945         $result[$key]['address'] = $result[$key]['name'];      
     2941        $result[$key]['name'] = $result[$key]['address'];         
     2942      elseif (empty($result[$key]['address'])) 
     2943        $result[$key]['address'] = $result[$key]['name']; 
    29462944      } 
    29472945     
Note: See TracChangeset for help on using the changeset viewer.