From 8219df7241e3c96bb6b7f9abfa057b8a64b1839f Mon Sep 17 00:00:00 2001 From: alec Date: Sun, 18 Sep 2011 09:02:35 +0000 Subject: - Cache synchronization using QRESYNC/CONDSTORE - Fixed message ID updates in cache - Changed message flags handling + some fixes (e.g. fixed messages listing after delete) git-svn-id: https://svn.roundcube.net/trunk@5233 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/steps/mail/check_recent.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'roundcubemail/program/steps/mail/check_recent.inc') diff --git a/roundcubemail/program/steps/mail/check_recent.inc b/roundcubemail/program/steps/mail/check_recent.inc index 0eab345ec..c7d607cf9 100644 --- a/roundcubemail/program/steps/mail/check_recent.inc +++ b/roundcubemail/program/steps/mail/check_recent.inc @@ -34,16 +34,24 @@ else { // check recent/unseen counts foreach ($a_mailboxes as $mbox_name) { + $is_current = $mbox_name == $current; + if ($is_current) { + // Synchronize mailbox cache, handle flag changes + $IMAP->mailbox_sync($mbox_name); + } + + // Get mailbox status $status = $IMAP->mailbox_status($mbox_name); if ($status & 1) { // trigger plugin hook - $RCMAIL->plugins->exec_hook('new_messages', array('mailbox' => $mbox_name)); + $RCMAIL->plugins->exec_hook('new_messages', + array('mailbox' => $mbox_name, 'is_current' => $is_current)); } rcmail_send_unread_count($mbox_name, true); - if ($status && $mbox_name == $current) { + if ($status && $is_current) { // refresh saved search set $search_request = get_input_value('_search', RCUBE_INPUT_GPC); if ($search_request && isset($_SESSION['search']) -- cgit v1.2.3