| | |
| | | // retrieve headers from IMAP |
| | | $a_msg_headers = array(); |
| | | |
| | | if (!$this->get_capability('sort') && ($msg_index = iil_C_Sort($this->conn, $mailbox, $this->sort_field, $this->skip_deleted ? 'UNDELETED' : ''))) |
| | | if ($this->get_capability('sort') && ($msg_index = iil_C_Sort($this->conn, $mailbox, $this->sort_field, $this->skip_deleted ? 'UNDELETED' : ''))) |
| | | { |
| | | list($begin, $end) = $this->_get_message_range(count($msg_index), $page); |
| | | $max = max($msg_index); |
| | |
| | | $msg_count = $this->_messagecount($mailbox); |
| | | $cache_count = count($cache_index); |
| | | |
| | | // console("Cache check: $msg_count !== ".count($cache_index)); |
| | | |
| | | // empty mailbox |
| | | if (!$msg_count) |
| | | return $cache_count ? -2 : 1; |
| | | |
| | | if ($cache_count==$msg_count) { |
| | | if ($this->skip_deleted) { |
| | | $h_index = iil_C_FetchHeaderIndex($this->conn, $mailbox, "1:*", 'UID', $this->skip_deleted); |