| | |
| | | { |
| | | if (empty($this->icache[$mailbox])) |
| | | $this->icache[$mailbox] = array(); |
| | | console('cache::get_index'); |
| | | |
| | | $sort_order = strtoupper($sort_order) == 'ASC' ? 'ASC' : 'DESC'; |
| | | |
| | | // Seek in internal cache |
| | |
| | | else { |
| | | $is_valid = $this->validate($mailbox, $index, $exists); |
| | | } |
| | | console("valid:".$is_valid); |
| | | |
| | | if ($is_valid) { |
| | | $data = $index['object']; |
| | | // revert the order if needed |
| | |
| | | $threads = $this->imap->fetch_threads($mailbox, true); |
| | | } |
| | | else { |
| | | $threads = new rcube_imap_result($mailbox, ''); |
| | | $threads = new rcube_result_thread($mailbox, '* THREAD'); |
| | | } |
| | | |
| | | $index['object'] = $threads; |
| | |
| | | */ |
| | | private function get_index_row($mailbox) |
| | | { |
| | | console('cache::get_index_row'); |
| | | // Get index from DB |
| | | $sql_result = $this->db->query( |
| | | "SELECT data, valid" |
| | |
| | | unset($data[0]); |
| | | |
| | | if (empty($thread)) { |
| | | $thread = new rcube_imap_result($mailbox); |
| | | $thread = new rcube_result_thread($mailbox); |
| | | } |
| | | |
| | | return array( |