Changeset 913 in subversion
- Timestamp:
- Nov 8, 2007 4:50:47 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap.inc
r912 r913 968 968 if ($headers) 969 969 { 970 if ($ is_uid)971 $this->uid_id_map[$m box_name][$uid] = $headers->id;970 if ($headers->uid && $headers->id) 971 $this->uid_id_map[$mailbox][$headers->uid] = $headers->id; 972 972 973 973 $this->add_message_cache($mailbox.'.msg', $headers->id, $headers); … … 1006 1006 { 1007 1007 $this->_msg_id = $msg_id; 1008 $headers = $this->get_headers($ msg_id, NULL, FALSE);1008 $headers = $this->get_headers($uid); 1009 1009 1010 1010 $struct = &$this->_structure_part($structure); … … 2067 2067 function &get_cached_message($key, $uid, $struct=false) 2068 2068 { 2069 if (!$this->caching_enabled)2070 return FALSE;2071 2072 2069 $internal_key = '__single_msg'; 2070 2073 2071 if ($this->caching_enabled && (!isset($this->cache[$internal_key][$uid]) || 2074 2072 ($struct && empty($this->cache[$internal_key][$uid]->structure)))) … … 2131 2129 function add_message_cache($key, $index, $headers, $struct=null) 2132 2130 { 2133 if (!$this->caching_enabled || empty($key) || !is_object($headers) || empty($headers->uid)) 2131 if (empty($key) || !is_object($headers) || empty($headers->uid)) 2132 return; 2133 2134 // add to internal (fast) cache 2135 $this->cache['__single_msg'][$headers->uid] = $headers; 2136 $this->cache['__single_msg'][$headers->uid]->structure = $struct; 2137 2138 // no further caching 2139 if (!$this->caching_enabled) 2134 2140 return; 2135 2141 2136 2142 // check for an existing record (probly headers are cached but structure not) 2137 2143 $sql_result = $this->db->query( … … 2489 2495 $mbox_name = $this->mailbox; 2490 2496 2491 return iil_C_ID2UID($this->conn, $mbox_name, $id); 2497 $index = array_flip($this->uid_id_map[$mbox_name]); 2498 if (isset($index[$id])) 2499 $uid = $index[$id]; 2500 else 2501 { 2502 $uid = iil_C_ID2UID($this->conn, $mbox_name, $id); 2503 $this->uid_id_map[$mbox_name][$uid] = $id; 2504 } 2505 2506 return $uid; 2492 2507 } 2493 2508
Note: See TracChangeset
for help on using the changeset viewer.
