thomascube
2006-07-27 06ec1f2fbda997fdb8254660412d811c20351c99
Re-enabled message sorting; removed unused vars

1 files modified
13 ■■■■ changed files
program/include/rcube_imap.inc 13 ●●●● patch | view | raw | blame | history
program/include/rcube_imap.inc
@@ -506,13 +506,9 @@
    if ($begin >= $end)
      return array();
        
//console("fetch headers $start_msg to ".($start_msg+$this->page_size)." (msg $begin to $end)");
    $headers_sorted = FALSE;
    $cache_key = $mailbox.'.msg';
    $cache_status = $this->check_cache_status($mailbox, $cache_key);
//console("Cache status = $cache_status");
    
    // cache is OK, we can get all messages from local cache
    if ($cache_status>0)
@@ -525,18 +521,13 @@
      // retrieve headers from IMAP
      if ($this->get_capability('sort') && ($msg_index = iil_C_Sort($this->conn, $mailbox, $this->sort_field, $this->skip_deleted ? 'UNDELETED' : '')))
        {
//console("$mailbox: ".join(',', $msg_index));
        $msgs = $msg_index[$begin];
        for ($i=$begin+1; $i < $end; $i++)
          $msgs = $msgs.','.$msg_index[$i];
        $sorted = TRUE;
        }
      else
        {
        $msgs = sprintf("%d:%d", $begin+1, $end);        
        $sorted = FALSE;
        }
@@ -568,8 +559,8 @@
    // if not already sorted
//    if (!$headers_sorted)
//      $a_msg_headers = iil_SortHeaders($a_msg_headers, $this->sort_field, $this->sort_order);
    if (!$headers_sorted)
      $a_msg_headers = iil_SortHeaders($a_msg_headers, $this->sort_field, $this->sort_order);
      if (!$headers_sorted && $this->sort_order == 'DESC')