summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-02 07:54:11 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-02 07:54:11 +0000
commit4819e5325e01100282a31b4da3e6ac449639699d (patch)
tree15670d236ada23bb01980f905adc0a8b2680d441 /roundcubemail/program/steps
parentaff48cb94a5b0832181aa55e2ddb4822b0010687 (diff)
Fix checking for new mail (#1485794)
git-svn-id: https://svn.roundcube.net/trunk@3299 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
-rw-r--r--roundcubemail/program/steps/mail/check_recent.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/mail/check_recent.inc b/roundcubemail/program/steps/mail/check_recent.inc
index 753304018..4ae6ad2be 100644
--- a/roundcubemail/program/steps/mail/check_recent.inc
+++ b/roundcubemail/program/steps/mail/check_recent.inc
@@ -22,6 +22,17 @@
$a_mailboxes = $IMAP->list_mailboxes();
$check_all = (bool)$RCMAIL->config->get('check_all_folders');
+// check if unread count of INBOX changed and refresh message list if so
+if (!empty($_GET['_refresh'])) {
+ $unread_count = $IMAP->messagecount('INBOX', 'UNSEEN', TRUE);
+ if ($unread_count > $_SESSION['unseen_count']['INBOX']) {
+ $OUTPUT->command('set_unread_count', 'INBOX', $unread_count, true);
+ $OUTPUT->command('list_mailbox', 'INBOX', 1); // let the client switch to INBOX and get the message list
+ $OUTPUT->send();
+ }
+}
+
+// check recent/unseen counts for all mailboxes
foreach ($a_mailboxes as $mbox_name) {
if ($mbox_name == $IMAP->get_mailbox_name()) {
if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE)) {