diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-06-11 13:35:03 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-06-11 13:35:03 +0000 |
| commit | 51a8e15e1c0aad3644faf917edd48da258304973 (patch) | |
| tree | bd9272b614b89a461edcefe1fdc4e7526ff421dc | |
| parent | ac92842163c4bcf5fe0a3ef504818e2aaaa574b8 (diff) | |
- speed up: don't count UNSEEN if mailbox is empty
git-svn-id: https://svn.roundcube.net/trunk@2636 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/steps/mail/mark.inc | 5 | ||||
| -rw-r--r-- | roundcubemail/program/steps/mail/move_del.inc | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/roundcubemail/program/steps/mail/mark.inc b/roundcubemail/program/steps/mail/mark.inc index 58a6f79df..6a8a3ca90 100644 --- a/roundcubemail/program/steps/mail/mark.inc +++ b/roundcubemail/program/steps/mail/mark.inc @@ -91,9 +91,8 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va // update mailboxlist $mbox = $IMAP->get_mailbox_name(); - $OUTPUT->command('set_unread_count', $mbox, $IMAP->messagecount($mbox, 'UNSEEN'), ($mbox == 'INBOX')); - -// $OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota())); + $unseen_count = $msg_count ? $IMAP->messagecount($mbox, 'UNSEEN') : 0; + $OUTPUT->command('set_unread_count', $mbox, $unseen_count, ($mbox == 'INBOX')); $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count)); // add new rows from next page (if any) diff --git a/roundcubemail/program/steps/mail/move_del.inc b/roundcubemail/program/steps/mail/move_del.inc index 9d7d77957..df7bef981 100644 --- a/roundcubemail/program/steps/mail/move_del.inc +++ b/roundcubemail/program/steps/mail/move_del.inc @@ -101,7 +101,8 @@ else // update mailboxlist $mbox = $IMAP->get_mailbox_name(); - $OUTPUT->command('set_unread_count', $mbox, $IMAP->messagecount($mbox, 'UNSEEN'), ($mbox == 'INBOX')); + $unseen_count = $msg_count ? $IMAP->messagecount($mbox, 'UNSEEN') : 0; + $OUTPUT->command('set_unread_count', $mbox, $unseen_count, ($mbox == 'INBOX')); if ($RCMAIL->action=='moveto' && $target) { $OUTPUT->command('set_unread_count', $target, $IMAP->messagecount($target, 'UNSEEN')); |
