| | |
| | | | Author: Thomas Bruederli <roundcube@gmail.com> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | $Id: check_recent.inc 233 2006-06-26 17:31:20Z richs $ |
| | | $Id$ |
| | | |
| | | */ |
| | | |
| | |
| | | } |
| | | |
| | | $unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE); |
| | | $_SESSION['unseen_count'][$mbox_name] = $unread_count; |
| | | |
| | | $OUTPUT->set_env('messagecount', $all_count); |
| | | $OUTPUT->set_env('pagesize', $IMAP->page_size); |
| | |
| | | $OUTPUT->command('new_message_focus'); |
| | | |
| | | if (!empty($_GET['_quota'])) |
| | | $OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota())); |
| | | $OUTPUT->command('set_quota', rcmail_quota_content()); |
| | | |
| | | // trigger plugin hook |
| | | $RCMAIL->plugins->exec_hook('new_messages', array('mailbox' => $mbox_name, 'count' => $unread_count)); |
| | |
| | | } |
| | | } |
| | | else { |
| | | send_unread_count($mbox_name); |
| | | rcmail_send_unread_count($mbox_name, true); |
| | | } |
| | | } |
| | | else if ($check_all) { |
| | | send_unread_count($mbox_name); |
| | | rcmail_send_unread_count($mbox_name, true); |
| | | } |
| | | } |
| | | |
| | | $OUTPUT->send(); |
| | | |
| | | |
| | | function send_unread_count($mbox_name) |
| | | { |
| | | global $RCMAIL; |
| | | |
| | | $old_unseen = $_SESSION['unseen_count'][$mbox_name]; |
| | | $unseen = $RCMAIL->imap->messagecount($mbox_name, 'UNSEEN', true); |
| | | |
| | | if ($unseen != $old_unseen) |
| | | $RCMAIL->output->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX')); |
| | | |
| | | // @TODO: this data is doubled (session and cache tables) if caching is enabled |
| | | $_SESSION['unseen_count'][$mbox_name] = $unseen; |
| | | } |
| | | |
| | | ?> |