summaryrefslogtreecommitdiff
path: root/program/steps/mail/check_recent.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-09-18 09:02:35 +0000
committeralecpl <alec@alec.pl>2011-09-18 09:02:35 +0000
commit609d3923d7dc674263ddea990387dbf5488fabc6 (patch)
tree8d7be69aa280e7d5848a23d2215fb85688514d4e /program/steps/mail/check_recent.inc
parent30f50556c130e272d9eb6ddcd11ea70a18a4e711 (diff)
- Cache synchronization using QRESYNC/CONDSTORE
- Fixed message ID updates in cache - Changed message flags handling + some fixes (e.g. fixed messages listing after delete)
Diffstat (limited to 'program/steps/mail/check_recent.inc')
-rw-r--r--program/steps/mail/check_recent.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index 0eab345ec..c7d607cf9 100644
--- a/program/steps/mail/check_recent.inc
+++ b/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'])