summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-09-16 19:08:07 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-09-16 19:08:07 +0000
commitb85d4e55bace30a42435698beafd648548a70541 (patch)
tree584206320f169567429260a9dee7c1fa39cf3de8 /roundcubemail/program
parent5c85ed30ccb4ef74291b003faeeba1456d35e1f6 (diff)
Trigger 'new_messages' hook for all checked folders (#1488083)
git-svn-id: https://svn.roundcube.net/trunk@5228 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/steps/mail/check_recent.inc18
1 files changed, 8 insertions, 10 deletions
diff --git a/roundcubemail/program/steps/mail/check_recent.inc b/roundcubemail/program/steps/mail/check_recent.inc
index d79359f5d..0eab345ec 100644
--- a/roundcubemail/program/steps/mail/check_recent.inc
+++ b/roundcubemail/program/steps/mail/check_recent.inc
@@ -34,10 +34,16 @@ else {
// check recent/unseen counts
foreach ($a_mailboxes as $mbox_name) {
- if ($mbox_name == $current && ($status = $IMAP->mailbox_status($mbox_name))) {
+ $status = $IMAP->mailbox_status($mbox_name);
- rcmail_send_unread_count($mbox_name, true);
+ if ($status & 1) {
+ // trigger plugin hook
+ $RCMAIL->plugins->exec_hook('new_messages', array('mailbox' => $mbox_name));
+ }
+
+ rcmail_send_unread_count($mbox_name, true);
+ if ($status && $mbox_name == $current) {
// refresh saved search set
$search_request = get_input_value('_search', RCUBE_INPUT_GPC);
if ($search_request && isset($_SESSION['search'])
@@ -70,11 +76,6 @@ foreach ($a_mailboxes as $mbox_name) {
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($all_count));
$OUTPUT->set_env('current_page', $all_count ? $IMAP->list_page : 1);
- if ($status & 1) {
- // trigger plugin hook
- $RCMAIL->plugins->exec_hook('new_messages', array('mailbox' => $mbox_name));
- }
-
// remove old rows (and clear selection if new list is empty)
$OUTPUT->command('message_list.clear', $all_count ? false : true);
@@ -86,9 +87,6 @@ foreach ($a_mailboxes as $mbox_name) {
$OUTPUT->command('update_selection');
}
}
- else {
- rcmail_send_unread_count($mbox_name, true);
- }
}
$RCMAIL->plugins->exec_hook('keep_alive', array());