summaryrefslogtreecommitdiff
path: root/program/steps/mail/move_del.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-09-17 12:07:58 +0000
committeralecpl <alec@alec.pl>2009-09-17 12:07:58 +0000
commit78925f8f1a9afb9475a9cf9ad1b35daade23da85 (patch)
treee17493f32eb5f11a6faa77ff64ef7f81a1e0c469 /program/steps/mail/move_del.inc
parent20e251599fa595102188bffb9fc5ffc4a1ca0166 (diff)
- Fix incorrect count of new messages in folder list when using multiple IMAP clients (#1485995)
- Fix all folders checking for new messages with disabled caching (#1486128)
Diffstat (limited to 'program/steps/mail/move_del.inc')
-rw-r--r--program/steps/mail/move_del.inc14
1 files changed, 12 insertions, 2 deletions
diff --git a/program/steps/mail/move_del.inc b/program/steps/mail/move_del.inc
index fbfbabf35..2a8cee633 100644
--- a/program/steps/mail/move_del.inc
+++ b/program/steps/mail/move_del.inc
@@ -102,10 +102,20 @@ else
// update mailboxlist
$mbox = $IMAP->get_mailbox_name();
$unseen_count = $msg_count ? $IMAP->messagecount($mbox, 'UNSEEN') : 0;
- $OUTPUT->command('set_unread_count', $mbox, $unseen_count, ($mbox == 'INBOX'));
+ $old_unseen = $_SESSION['unseen_count'][$mbox];
+
+ if ($old_unseen != $unseen_count) {
+ $OUTPUT->command('set_unread_count', $mbox, $unseen_count, ($mbox == 'INBOX'));
+ $_SESSION['unseen_count'][$mbox] = $unseen_count;
+ }
if ($RCMAIL->action=='moveto' && $target) {
- $OUTPUT->command('set_unread_count', $target, $IMAP->messagecount($target, 'UNSEEN'));
+ $unseen_count = $IMAP->messagecount($target, 'UNSEEN', true);
+ $old_unseen = $_SESSION['unseen_count'][$target];
+ if ($old_unseen != $unseen_count) {
+ $OUTPUT->command('set_unread_count', $target, $unseen_count);
+ $_SESSION['unseen_count'][$target] = $unseen_count;
+ }
}
$OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota()));