Aleksander Machniak
2012-08-11 51fcb01f0a86d148b470571c7e32dd089c9b090b
program/steps/mail/pagenav.inc
@@ -5,7 +5,7 @@
 | program/steps/mail/pagenav.inc                                        |
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2009, Roundcube Dev. - Switzerland                 |
 | Copyright (C) 2005-2009, The Roundcube Dev Team                       |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 | PURPOSE:                                                              |
@@ -28,7 +28,7 @@
// Get messages count (only messages, no threads here)
$cnt  = $IMAP->messagecount(NULL, 'ALL');
if ($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] != 'DESC'
if ($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] == 'DESC'
    && empty($_REQUEST['_search']) && !$CONFIG['skip_deleted'] && !$IMAP->threading
) {
    // this assumes that we are sorted by date_DESC
@@ -42,7 +42,7 @@
}
else {
    // Only if we use custom sorting
    $a_msg_index = $IMAP->message_index(NULL, $_SESSION['sort_col'], $_SESSION['sort_order']);
    $a_msg_index = $IMAP->message_index(NULL, rcmail_sort_column(), rcmail_sort_order());
    $index = array_search($IMAP->get_id($uid), $a_msg_index);