thomascube
2006-05-05 ded2b7e166d4b0acab09c00f22f379fbabba709a
commit | author | age
15a9d1 1 <?php
T 2
3 /*
4  +-----------------------------------------------------------------------+
5  | program/steps/mail/getunread.inc                                      |
6  |                                                                       |
7  | This file is part of the RoundCube Webmail client                     |
8  | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
9  | Licensed under the GNU GPL                                            |
10  |                                                                       |
11  | PURPOSE:                                                              |
12  |   Check all mailboxes for unread messages and update GUI              |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id$
19
20 */
21
22 $REMOTE_REQUEST = TRUE;
23
24 $a_folders = $IMAP->list_mailboxes();
25
26 if (!empty($a_folders))
27   {
28   foreach ($a_folders as $mbox)
29     {
30     $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox, $IMAP->messagecount($mbox, 'UNSEEN'));
31     rcube_remote_response($commands, TRUE);
c03095 32     ob_flush();
15a9d1 33     }
T 34   }
35
36 exit;
37 ?>