summaryrefslogtreecommitdiff
path: root/program/steps/mail/getunread.inc
diff options
context:
space:
mode:
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);
}
}