summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2006-08-02 22:05:42 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2006-08-02 22:05:42 +0000
commiteca6d58b152ca833017703b335fe1574d3aa279e (patch)
tree361bc5e326e22b6a21ecaca603a074892f1e67f3 /roundcubemail/program/include
parent3b6fad89188f361f5ef6be2352771fb13394ba2d (diff)
Message sorting: added patch by Eric; fixed check-for-recent confusion
git-svn-id: https://svn.roundcube.net/trunk@291 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_imap.inc39
1 files changed, 15 insertions, 24 deletions
diff --git a/roundcubemail/program/include/rcube_imap.inc b/roundcubemail/program/include/rcube_imap.inc
index 630d2fb8b..b37425769 100644
--- a/roundcubemail/program/include/rcube_imap.inc
+++ b/roundcubemail/program/include/rcube_imap.inc
@@ -516,32 +516,33 @@ class rcube_imap
$a_msg_headers = $this->get_message_cache($cache_key, $start_msg, $start_msg+$this->page_size, $this->sort_field, $this->sort_order);
$headers_sorted = TRUE;
}
+ // cache is dirty, sync it
+ else if ($this->caching_enabled && $cache_status==-1 && !$recursive)
+ {
+ $this->sync_header_index($mailbox);
+ return $this->_list_headers($mailbox, $page, $this->sort_field, $this->sort_order, TRUE);
+ }
else
{
- $sorter = new rcube_header_sorter();
-
// retrieve headers from IMAP
if ($this->get_capability('sort') && ($msg_index = iil_C_Sort($this->conn, $mailbox, $this->sort_field, $this->skip_deleted ? 'UNDELETED' : '')))
- {
- $sorter->set_sequence_numbers($msg_index);
-
+ {
$msgs = $msg_index[$begin];
for ($i=$begin+1; $i < $end; $i++)
$msgs = $msgs.','.$msg_index[$i];
}
else
{
- $msgs = sprintf("%d:%d", $begin+1, $end);
- }
-
+ $msgs = sprintf("%d:%d", $begin+1, $end);
- // cache is dirty, sync it
- if ($this->caching_enabled && $cache_status==-1 && !$recursive)
- {
- $this->sync_header_index($mailbox);
- return $this->_list_headers($mailbox, $page, $this->sort_field, $this->sort_order, TRUE);
- }
+ $i = 0;
+ for ($msg_seqnum = $begin; $msg_seqnum <= $end; $msg_seqnum++)
+ $msg_index[$i++] = $msg_seqnum;
+ }
+ // use this class for message sorting
+ $sorter = new rcube_header_sorter();
+ $sorter->set_sequence_numbers($msg_index);
// fetch reuested headers from server
$a_msg_headers = array();
@@ -576,16 +577,6 @@ class rcube_imap
-
-
-function gethdrids($hdr)
-{
- return $hdr->uid . ',' . $hdr->id;
-}
-
-
-
-
/**
* Public method for listing a specific set of headers
* convert mailbox name with root dir first