- 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)
release-0.6
alecpl 15 years ago
parent 20e251599f
commit 78925f8f1a

@ -1,6 +1,8 @@
CHANGELOG RoundCube Webmail
===========================
- 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)
- Support skins in 'archive' and 'markasjunk' plugins
- Added 'html_editor' hook (#1486068)
- Fix DB constraint violation when populating messages cache (#1486052)

@ -68,12 +68,30 @@ foreach ($a_mailboxes as $mbox_name) {
rcmail_js_message_list($result_h, true, false);
}
}
else {
send_unread_count($mbox_name);
}
}
else if ($unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', $check_all)) {
$OUTPUT->command('set_unread_count', $mbox_name, $unseen);
else if ($check_all) {
send_unread_count($mbox_name);
}
}
$OUTPUT->send();
function send_unread_count($mbox_name)
{
global $RCMAIL;
$old_unseen = $_SESSION['unseen_count'][$mbox_name];
$unseen = $RCMAIL->imap->messagecount($mbox_name, 'UNSEEN', true);
if ($unseen != $old_unseen)
$RCMAIL->output->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX'));
// @TODO: this data is doubled (session and cache tables) if caching is enabled
$_SESSION['unseen_count'][$mbox_name] = $unseen;
}
?>

@ -60,6 +60,7 @@ else if ($RCMAIL->action=='purge' && ($mbox = get_input_value('_mbox', RCUBE_INP
$OUTPUT->command('message_list.clear');
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text());
$OUTPUT->command('set_unread_count', $mbox_name, 0);
$_SESSION['unseen_count'][$mbox_name] = 0;
}
else
$commands = "// purged: $success";
@ -67,4 +68,5 @@ else if ($RCMAIL->action=='purge' && ($mbox = get_input_value('_mbox', RCUBE_INP
}
$OUTPUT->send($commands);
?>

@ -24,9 +24,16 @@ $a_folders = $IMAP->list_mailboxes();
if (!empty($a_folders))
{
$inbox = ($IMAP->get_mailbox_name() == 'INBOX');
foreach ($a_folders as $mbox_row)
$OUTPUT->command('set_unread_count', $mbox_row, $IMAP->messagecount($mbox_row, 'UNSEEN'), $inbox && $mbox_row == 'INBOX');
foreach ($a_folders as $mbox_row) {
$unseen = $IMAP->messagecount($mbox_row, 'UNSEEN', !isset($_SESSION['unseen_count'][$mbox_row]));
$_SESSION['unseen_count'][$mbox_row] = $unseen;
if ($unseen) {
$OUTPUT->command('set_unread_count', $mbox_row, $unseen, $inbox && $mbox_row == 'INBOX');
}
}
}
$OUTPUT->send();
?>

@ -60,7 +60,14 @@ if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL')
if ($count = $IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh'])))
$a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order);
// count UNSEEN messages...
$old_unseen = $_SESSION['unseen_count'][$mbox_name];
$unseen = $count ? $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh'])) : 0;
$_SESSION['unseen_count'][$mbox_name] = $unseen;
// ...and update mailboxlist
if ($unseen != $old_unseen)
$OUTPUT->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX'));
// update message count display
$pages = ceil($count/$IMAP->page_size);
@ -80,9 +87,6 @@ else if ($search_request)
$OUTPUT->show_message('searchnomatch', 'notice');
else
$OUTPUT->show_message('nomessagesfound', 'notice');
// update mailboxlist
$OUTPUT->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX'));
// send response
$OUTPUT->send();

@ -62,7 +62,12 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va
if ($flag == 'SEEN' || $flag == 'UNSEEN' || ($flag == 'DELETED' && !$CONFIG['skip_deleted'])) {
$mbox_name = $IMAP->get_mailbox_name();
$OUTPUT->command('set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'), ($mbox_name == 'INBOX'));
$unseen = $IMAP->messagecount($mbox_name, 'UNSEEN');
$old_unseen = $_SESSION['unseen_count'][$mbox_name];
if ($old_unseen != $unseen) {
$OUTPUT->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX'));
$_SESSION['unseen_count'][$mbox_name] = $unseen;
}
}
else if ($flag == 'DELETED' && $CONFIG['skip_deleted']) {
if ($_POST['_from'] == 'show') {
@ -96,7 +101,11 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va
// 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;
}
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count));
// add new rows from next page (if any)

@ -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()));

Loading…
Cancel
Save