4 +-----------------------------------------------------------------------+
5 | program/steps/mail/check_recent.inc |
7 | This file is part of the RoundCube Webmail client |
8 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland |
9 | Licensed under the GNU GPL |
12 | Check for recent messages, in all mailboxes |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com> |
16 +-----------------------------------------------------------------------+
18 $Id: check_recent.inc 233 2006-06-26 17:31:20Z richs $
22 $a_mailboxes = $IMAP->list_mailboxes();
24 foreach ($a_mailboxes as $mbox_name)
26 if ($mbox_name == $IMAP->get_mailbox_name())
28 if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE))
30 $count = $IMAP->messagecount(NULL, 'ALL', TRUE);
31 $unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE);
33 $OUTPUT->set_env('messagecount', $count);
34 $OUTPUT->command('set_unread_count', $mbox_name, $unread_count);
35 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text());
36 $OUTPUT->command('set_quota', $IMAP->get_quota());
38 // add new message headers to list
40 for ($i=$recent_count, $id=$count-$recent_count+1; $i>0; $i--, $id++)
42 $header = $IMAP->get_headers($id, NULL, FALSE);
44 $a_headers[] = $header;
47 rcmail_js_message_list($a_headers, TRUE);
52 if ($IMAP->messagecount($mbox_name, 'RECENT'))
53 $OUTPUT->command('set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'));