Changeset 283 in subversion


Ignore:
Timestamp:
Jul 27, 2006 5:08:19 PM (7 years ago)
Author:
thomasb
Message:

Re-enabled message sorting; removed unused vars

File:
1 edited

Legend:

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

    r277 r283  
    500500    $max = $this->_messagecount($mailbox); 
    501501    $start_msg = ($this->list_page-1) * $this->page_size; 
    502      
     502 
    503503    list($begin, $end) = $this->_get_message_range($max, $page); 
    504    
     504 
    505505        // mailbox is empty 
    506506    if ($begin >= $end) 
    507507      return array(); 
    508          
    509 //console("fetch headers $start_msg to ".($start_msg+$this->page_size)." (msg $begin to $end)"); 
    510508 
    511509    $headers_sorted = FALSE; 
     
    513511    $cache_status = $this->check_cache_status($mailbox, $cache_key); 
    514512 
    515 //console("Cache status = $cache_status"); 
    516      
    517513    // cache is OK, we can get all messages from local cache 
    518514    if ($cache_status>0) 
     
    526522      if ($this->get_capability('sort') && ($msg_index = iil_C_Sort($this->conn, $mailbox, $this->sort_field, $this->skip_deleted ? 'UNDELETED' : ''))) 
    527523        { 
    528 //console("$mailbox: ".join(',', $msg_index)); 
    529          
    530524        $msgs = $msg_index[$begin]; 
    531525        for ($i=$begin+1; $i < $end; $i++) 
    532526          $msgs = $msgs.','.$msg_index[$i]; 
    533  
    534         $sorted = TRUE; 
    535527        } 
    536528      else 
    537529        { 
    538530        $msgs = sprintf("%d:%d", $begin+1, $end);         
    539         $sorted = FALSE; 
    540531        } 
    541532 
     
    548539        }       
    549540 
    550          
     541 
    551542      // fetch reuested headers from server 
    552543      $a_msg_headers = array(); 
     
    556547      $this->clear_message_cache($cache_key, $max); 
    557548 
    558          
     549 
    559550      // kick child process to sync cache 
    560551      // ... 
    561        
     552 
    562553      } 
    563554 
     
    569560 
    570561    // if not already sorted 
    571 //    if (!$headers_sorted) 
    572 //      $a_msg_headers = iil_SortHeaders($a_msg_headers, $this->sort_field, $this->sort_order); 
    573  
    574  
    575       if (!$headers_sorted && $this->sort_order == 'DESC') 
    576         $a_msg_headers = array_reverse($a_msg_headers); 
    577        
     562    if (!$headers_sorted) 
     563      $a_msg_headers = iil_SortHeaders($a_msg_headers, $this->sort_field, $this->sort_order); 
     564 
     565 
     566    if (!$headers_sorted && $this->sort_order == 'DESC') 
     567      $a_msg_headers = array_reverse($a_msg_headers); 
     568 
    578569 
    579570    return array_values($a_msg_headers); 
Note: See TracChangeset for help on using the changeset viewer.