summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-03-03 08:41:37 +0000
committeralecpl <alec@alec.pl>2010-03-03 08:41:37 +0000
commit349bb1cc4506aa4b1ab45e57ed098a8a132962e5 (patch)
tree3e821d4cfdce03749404d5b2129bd415808abbbb
parentf2cdc551e77ff609bcb4418c22437b8130227217 (diff)
- fix order of messages added by check_recent
-rw-r--r--program/steps/mail/check_recent.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index caf8b8282..9bc9e6f92 100644
--- a/program/steps/mail/check_recent.inc
+++ b/program/steps/mail/check_recent.inc
@@ -62,8 +62,10 @@ foreach ($a_mailboxes as $mbox_name) {
$search_str .= ' '.$IMAP->search_string;
if ($IMAP->search($mbox_name, $search_str, NULL, 'date')) {
+ // revert sort order
+ $order = $_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] == 'DESC' ? 'ASC' : 'DESC';
// get the headers and add them to the list
- $result_h = $IMAP->list_headers($mbox_name, 1, 'date', 'DESC');
+ $result_h = $IMAP->list_headers($mbox_name, 1, 'date', $order);
rcmail_js_message_list($result_h, true, false);
}
}