diff options
author | alecpl <alec@alec.pl> | 2010-06-04 07:18:26 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-06-04 07:18:26 +0000 |
commit | 2144f9c43237056da7cb2a3224719faa118d1795 (patch) | |
tree | 1c42c77551ec7ed1335ee6f3b50bc5d939312a95 /program/steps/mail/func.inc | |
parent | f22b5439f2e783f47f61042bebb6cc53672568fd (diff) |
- Skip UNSEEN counting when list is empty
Diffstat (limited to 'program/steps/mail/func.inc')
-rw-r--r-- | program/steps/mail/func.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 5e53a75e5..d1850d6cf 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -551,12 +551,16 @@ function rcmail_get_mailbox_name_text() } -function rcmail_send_unread_count($mbox_name, $force=false) +function rcmail_send_unread_count($mbox_name, $force=false, $count=null) { global $RCMAIL; $old_unseen = $_SESSION['unseen_count'][$mbox_name]; - $unseen = $RCMAIL->imap->messagecount($mbox_name, 'UNSEEN', $force); + + if ($count === null) + $unseen = $RCMAIL->imap->messagecount($mbox_name, 'UNSEEN', $force); + else + $unseen = $count; if ($unseen != $old_unseen || ($mbox_name == 'INBOX')) $RCMAIL->output->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX')); |