4 +-----------------------------------------------------------------------+
5 | program/steps/mail/getunread.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 all mailboxes for unread messages and update GUI |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com> |
16 +-----------------------------------------------------------------------+
18 $Id: getunread.inc 2966 2009-09-18 10:15:17Z alec $
22 $a_folders = $IMAP->list_mailboxes();
24 if (!empty($a_folders))
26 $inbox = ($IMAP->get_mailbox_name() == 'INBOX');
27 foreach ($a_folders as $mbox_row) {
28 $unseen = $IMAP->messagecount($mbox_row, 'UNSEEN', !isset($_SESSION['unseen_count'][$mbox_row]));
30 if ($unseen || !isset($_SESSION['unseen_count'][$mbox_row])) {
31 $OUTPUT->command('set_unread_count', $mbox_row, $unseen, $inbox && $mbox_row == 'INBOX');
33 $_SESSION['unseen_count'][$mbox_row] = $unseen;