From 92592f0e499f6174edf119a56e3571556c43f2be Mon Sep 17 00:00:00 2001 From: jmunro Date: Mon, 1 Apr 2002 07:19:43 +0000 Subject: [PATCH] fix pref/next links when using server-side sorting git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2657 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/read_body.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/read_body.php b/src/read_body.php index b245fc4e..92b3f022 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -27,12 +27,13 @@ require_once('../functions/smtp.php'); * returns the index of the next valid message from the array */ function findNextMessage() { - global $msort, $currentArrayIndex, $msgs, $sort, $thread_sort_messages; + global $msort, $currentArrayIndex, $msgs, $sort, + $thread_sort_messages, $allow_server_sort; $result = -1; if ($thread_sort_messages == 1) { $sort = 0; } - if ($sort == 6) { + if ($sort == 6 && $allow_server_sort != TRUE) { if ($currentArrayIndex != 1) { $result = $currentArrayIndex - 1; } @@ -65,14 +66,15 @@ function RemoveAddress(&$addr_list, $addr) { /** returns the index of the previous message from the array. */ function findPreviousMessage() { global $msort, $currentArrayIndex, $sort, $msgs, $imapConnection, - $mailbox, $data_dir, $username, $thread_sort_messages; + $mailbox, $data_dir, $username, $thread_sort_messages, + $allow_server_sort; if ($thread_sort_messages == 1) { $sort = 0; } $result = -1; - if ($sort == 6) { + if ($sort == 6 && $allow_server_sort != TRUE) { $numMessages = sqimap_get_num_messages($imapConnection, $mailbox); if ($currentArrayIndex != $numMessages) { $result = $currentArrayIndex + 1; -- 2.25.1