diff options
author | alecpl <alec@alec.pl> | 2009-09-17 12:07:58 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-09-17 12:07:58 +0000 |
commit | 78925f8f1a9afb9475a9cf9ad1b35daade23da85 (patch) | |
tree | e17493f32eb5f11a6faa77ff64ef7f81a1e0c469 /program/steps/mail/list.inc | |
parent | 20e251599fa595102188bffb9fc5ffc4a1ca0166 (diff) |
- Fix incorrect count of new messages in folder list when using multiple IMAP clients (#1485995)
- Fix all folders checking for new messages with disabled caching (#1486128)
Diffstat (limited to 'program/steps/mail/list.inc')
-rw-r--r-- | program/steps/mail/list.inc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc index 8ba0dd017..a40fce679 100644 --- a/program/steps/mail/list.inc +++ b/program/steps/mail/list.inc @@ -60,7 +60,14 @@ if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') if ($count = $IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh']))) $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order); +// count UNSEEN messages... +$old_unseen = $_SESSION['unseen_count'][$mbox_name]; $unseen = $count ? $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh'])) : 0; +$_SESSION['unseen_count'][$mbox_name] = $unseen; + +// ...and update mailboxlist +if ($unseen != $old_unseen) + $OUTPUT->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX')); // update message count display $pages = ceil($count/$IMAP->page_size); @@ -80,9 +87,6 @@ else if ($search_request) $OUTPUT->show_message('searchnomatch', 'notice'); else $OUTPUT->show_message('nomessagesfound', 'notice'); - -// update mailboxlist -$OUTPUT->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX')); // send response $OUTPUT->send(); |