summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-06-10 12:07:55 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-06-10 12:07:55 +0000
commit4ad9c2ad4d30ada1608db658c1883df7f2b355a9 (patch)
tree0b9b7a54a75adee487f4b1e7ad67e5ad20e2b2c1 /roundcubemail/program/steps/mail
parentaab701b118ec3f4628ce843c5f799ce0e68ae097 (diff)
- Fixed many 'skip_deleted' issues (#1485634)
- Fixed messages list sorting on servers without SORT capability - some preformance improvements git-svn-id: https://svn.roundcube.net/trunk@2629 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail')
-rw-r--r--roundcubemail/program/steps/mail/show.inc28
1 files changed, 14 insertions, 14 deletions
diff --git a/roundcubemail/program/steps/mail/show.inc b/roundcubemail/program/steps/mail/show.inc
index 9beb42521..6ab5ba86a 100644
--- a/roundcubemail/program/steps/mail/show.inc
+++ b/roundcubemail/program/steps/mail/show.inc
@@ -98,20 +98,8 @@ if ($_GET['_uid']) {
{
$next = $prev = $first = $last = -1;
- if ((!($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] == 'DESC') &&
- $IMAP->get_capability('sort')) || !empty($_REQUEST['_search']))
- {
- // Only if we use custom sorting
- $a_msg_index = $IMAP->message_index(NULL, $_SESSION['sort_col'], $_SESSION['sort_order']);
-
- $MESSAGE->index = array_search($IMAP->get_id($MESSAGE->uid), $a_msg_index);
-
- $prev = isset($a_msg_index[$MESSAGE->index-1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index-1]) : -1 ;
- $first = count($a_msg_index)>0 ? $IMAP->get_uid($a_msg_index[0]) : -1;
- $next = isset($a_msg_index[$MESSAGE->index+1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index+1]) : -1 ;
- $last = count($a_msg_index)>0 ? $IMAP->get_uid($a_msg_index[count($a_msg_index)-1]) : -1;
- }
- else
+ if ($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] != 'DESC'
+ && empty($_REQUEST['_search']) && !$IMAP->skip_deleted)
{
// this assumes that we are sorted by date_DESC
$cnt = $IMAP->messagecount();
@@ -123,6 +111,18 @@ if ($_GET['_uid']) {
$next = $IMAP->get_uid($seq - 1);
$last = $IMAP->get_uid(1);
}
+ else
+ {
+ // Only if we use custom sorting
+ $a_msg_index = $IMAP->message_index(NULL, $_SESSION['sort_col'], $_SESSION['sort_order']);
+
+ $MESSAGE->index = array_search($IMAP->get_id($MESSAGE->uid), $a_msg_index);
+
+ $prev = isset($a_msg_index[$MESSAGE->index-1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index-1]) : -1 ;
+ $first = count($a_msg_index)>0 ? $IMAP->get_uid($a_msg_index[0]) : -1;
+ $next = isset($a_msg_index[$MESSAGE->index+1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index+1]) : -1 ;
+ $last = count($a_msg_index)>0 ? $IMAP->get_uid($a_msg_index[count($a_msg_index)-1]) : -1;
+ }
if ($prev > 0)
$OUTPUT->set_env('prev_uid', $prev);