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/mark.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/mark.inc')
-rw-r--r-- | program/steps/mail/mark.inc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/program/steps/mail/mark.inc b/program/steps/mail/mark.inc index c3ddf7b8c..c065b3f92 100644 --- a/program/steps/mail/mark.inc +++ b/program/steps/mail/mark.inc @@ -62,7 +62,12 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va if ($flag == 'SEEN' || $flag == 'UNSEEN' || ($flag == 'DELETED' && !$CONFIG['skip_deleted'])) { $mbox_name = $IMAP->get_mailbox_name(); - $OUTPUT->command('set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'), ($mbox_name == 'INBOX')); + $unseen = $IMAP->messagecount($mbox_name, 'UNSEEN'); + $old_unseen = $_SESSION['unseen_count'][$mbox_name]; + if ($old_unseen != $unseen) { + $OUTPUT->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX')); + $_SESSION['unseen_count'][$mbox_name] = $unseen; + } } else if ($flag == 'DELETED' && $CONFIG['skip_deleted']) { if ($_POST['_from'] == 'show') { @@ -96,7 +101,11 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va // update mailboxlist $mbox = $IMAP->get_mailbox_name(); $unseen_count = $msg_count ? $IMAP->messagecount($mbox, 'UNSEEN') : 0; - $OUTPUT->command('set_unread_count', $mbox, $unseen_count, ($mbox == 'INBOX')); + $old_unseen = $_SESSION['unseen_count'][$mbox]; + if ($old_unseen != $unseen_count) { + $OUTPUT->command('set_unread_count', $mbox, $unseen_count, ($mbox == 'INBOX')); + $_SESSION['unseen_count'][$mbox] = $unseen_count; + } $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count)); // add new rows from next page (if any) |