Ignore:
Timestamp:
Aug 2, 2006 6:05:42 PM (7 years ago)
Author:
thomasb
Message:

Message sorting: added patch by Eric; fixed check-for-recent confusion

File:
1 edited

Legend:

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

    r288 r291  
    517517      $headers_sorted = TRUE; 
    518518      } 
     519    // cache is dirty, sync it 
     520    else if ($this->caching_enabled && $cache_status==-1 && !$recursive) 
     521      { 
     522      $this->sync_header_index($mailbox); 
     523      return $this->_list_headers($mailbox, $page, $this->sort_field, $this->sort_order, TRUE); 
     524      } 
    519525    else 
    520526      { 
    521       $sorter = new rcube_header_sorter(); 
    522  
    523527      // retrieve headers from IMAP 
    524528      if ($this->get_capability('sort') && ($msg_index = iil_C_Sort($this->conn, $mailbox, $this->sort_field, $this->skip_deleted ? 'UNDELETED' : ''))) 
    525         { 
    526         $sorter->set_sequence_numbers($msg_index); 
    527          
     529        {         
    528530        $msgs = $msg_index[$begin]; 
    529531        for ($i=$begin+1; $i < $end; $i++) 
     
    532534      else 
    533535        { 
    534         $msgs = sprintf("%d:%d", $begin+1, $end);         
    535         } 
    536  
    537  
    538       // cache is dirty, sync it 
    539       if ($this->caching_enabled && $cache_status==-1 && !$recursive) 
    540         { 
    541         $this->sync_header_index($mailbox); 
    542         return $this->_list_headers($mailbox, $page, $this->sort_field, $this->sort_order, TRUE); 
    543         }       
    544  
     536        $msgs = sprintf("%d:%d", $begin+1, $end); 
     537 
     538        $i = 0; 
     539        for ($msg_seqnum = $begin; $msg_seqnum <= $end; $msg_seqnum++) 
     540          $msg_index[$i++] = $msg_seqnum; 
     541        } 
     542 
     543      // use this class for message sorting 
     544      $sorter = new rcube_header_sorter(); 
     545      $sorter->set_sequence_numbers($msg_index); 
    545546 
    546547      // fetch reuested headers from server 
     
    574575    return array_values($a_msg_headers); 
    575576    } 
    576  
    577  
    578  
    579  
    580  
    581 function gethdrids($hdr) 
    582 { 
    583    return $hdr->uid . ',' . $hdr->id; 
    584 } 
    585  
    586577 
    587578 
Note: See TracChangeset for help on using the changeset viewer.