summaryrefslogtreecommitdiff
path: root/program/steps/mail/getunread.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2010-12-17 15:07:04 +0000
committerthomascube <thomas@roundcube.net>2010-12-17 15:07:04 +0000
commitdb1a87cd6c506f2afbd1a37c64cb56ae11120b49 (patch)
tree07e1d350a06e0529db08316621b9c629bfb90b58 /program/steps/mail/getunread.inc
parentacd5200b2110498793e04fb016cbbc69ea5fe9f3 (diff)
Update branch for 0.5-rc releasev0.5-rc@4349
Diffstat (limited to 'program/steps/mail/getunread.inc')
-rw-r--r--program/steps/mail/getunread.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/program/steps/mail/getunread.inc b/program/steps/mail/getunread.inc
index a035f5204..e60f36cae 100644
--- a/program/steps/mail/getunread.inc
+++ b/program/steps/mail/getunread.inc
@@ -28,15 +28,18 @@ if (!empty($a_folders))
$check_all = (bool)$RCMAIL->config->get('check_all_folders');
foreach ($a_folders as $mbox_row) {
- if (!$check_all && isset($_SESSION['unseen_count'][$mbox_row]) && $mbox_row != $current)
- $unseen = $_SESSION['unseen_count'][$mbox_row];
+ $unseen_old = rcmail_get_unseen_count($mbox_row);
+
+ if (!$check_all && $unseen_old !== null && $mbox_row != $current)
+ $unseen = $unseen_old;
else
- $unseen = $IMAP->messagecount($mbox_row, 'UNSEEN', !isset($_SESSION['unseen_count'][$mbox_row]));
+ $unseen = $IMAP->messagecount($mbox_row, 'UNSEEN', $unseen_old === null);
- if ($unseen || !isset($_SESSION['unseen_count'][$mbox_row])) {
+ if ($unseen || $unseen_old === null) {
$OUTPUT->command('set_unread_count', $mbox_row, $unseen, $inbox && $mbox_row == 'INBOX');
}
- $_SESSION['unseen_count'][$mbox_row] = $unseen;
+
+ rcmail_set_unseen_count($mbox_row, $unseen);
}
}