thomascube
2011-09-16 47672bfda519f6663c9a92b1039d45d9775bbc0d
program/steps/mail/check_recent.inc
@@ -24,7 +24,7 @@
// list of folders to check
if ($check_all) {
    $a_mailboxes = $IMAP->list_mailboxes();
    $a_mailboxes = $IMAP->list_mailboxes('', '*', 'mail');
}
else {
    $a_mailboxes = (array) $current;
@@ -34,10 +34,16 @@
// check recent/unseen counts
foreach ($a_mailboxes as $mbox_name) {
    if ($mbox_name == $current && ($status = $IMAP->mailbox_status($mbox_name))) {
    $status = $IMAP->mailbox_status($mbox_name);
        rcmail_send_unread_count($mbox_name, true);
    if ($status & 1) {
        // trigger plugin hook
        $RCMAIL->plugins->exec_hook('new_messages', array('mailbox' => $mbox_name));
    }
    rcmail_send_unread_count($mbox_name, true);
    if ($status && $mbox_name == $current) {
        // refresh saved search set
        $search_request = get_input_value('_search', RCUBE_INPUT_GPC);
        if ($search_request && isset($_SESSION['search'])
@@ -70,13 +76,6 @@
        $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($all_count));
        $OUTPUT->set_env('current_page', $all_count ? $IMAP->list_page : 1);
        if ($status & 1) {
            if ($RCMAIL->config->get('focus_on_new_message', true))
                $OUTPUT->command('new_message_focus');
            // trigger plugin hook
            $RCMAIL->plugins->exec_hook('new_messages', array('mailbox' => $mbox_name));
        }
        // remove old rows (and clear selection if new list is empty)
        $OUTPUT->command('message_list.clear', $all_count ? false : true);
@@ -88,9 +87,8 @@
            $OUTPUT->command('update_selection');
        }
    }
    else {
        rcmail_send_unread_count($mbox_name, true);
    }
}
$RCMAIL->plugins->exec_hook('keep_alive', array());
$OUTPUT->send();