diff options
author | alecpl <alec@alec.pl> | 2008-11-13 10:30:06 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2008-11-13 10:30:06 +0000 |
commit | e538b3dc7d740c5a9213ef352437f249be856d3a (patch) | |
tree | 5ff0bf1bf9b0a336ad5da3e29d11e4e3305f6558 /program/steps/mail/show.inc | |
parent | 6fa87f3fa5579da0935dc6ee29af77aea19ad872 (diff) |
- Added message status filter + fixes for r2046 (searching with SORT)
Diffstat (limited to 'program/steps/mail/show.inc')
-rw-r--r-- | program/steps/mail/show.inc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index 8b36c9acd..15c1c54a6 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -110,12 +110,13 @@ if ($_GET['_uid']) { { // Only if we use custom sorting $a_msg_index = $IMAP->message_index(NULL, $_SESSION['sort_col'], $_SESSION['sort_order']); - - $MESSAGE->index = array_search((string)$MESSAGE->uid, $a_msg_index, TRUE); - $prev = isset($a_msg_index[$MESSAGE->index-1]) ? $a_msg_index[$MESSAGE->index-1] : -1 ; - $first = count($a_msg_index)>0 ? $a_msg_index[0] : -1; - $next = isset($a_msg_index[$MESSAGE->index+1]) ? $a_msg_index[$MESSAGE->index+1] : -1 ; - $last = count($a_msg_index)>0 ? $a_msg_index[count($a_msg_index)-1] : -1; + + $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 { @@ -130,11 +131,11 @@ if ($_GET['_uid']) { if ($prev > 0) $OUTPUT->set_env('prev_uid', $prev); - if ($first >0) + if ($first > 0) $OUTPUT->set_env('first_uid', $first); if ($next > 0) $OUTPUT->set_env('next_uid', $next); - if ($last >0) + if ($last > 0) $OUTPUT->set_env('last_uid', $last); // mark message as read |