[Svn] r5228 - in trunk/roundcubemail: . program/steps/mail

trac at roundcube.net trac at roundcube.net
Fri Sep 16 21:08:07 CEST 2011


Author: thomasb
Date: 2011-09-16 14:08:07 -0500 (Fri, 16 Sep 2011)
New Revision: 5228

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/steps/mail/check_recent.inc
Log:
Trigger 'new_messages' hook for all checked folders (#1488083)

Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2011-09-16 17:54:07 UTC (rev 5227)
+++ trunk/roundcubemail/CHANGELOG	2011-09-16 19:08:07 UTC (rev 5228)
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Trigger 'new_messages' hook for all checked folders (#1488083)
 - Fix session race conditions when composing new messages
 - Fix encoding of LDAP contacts identifiers (#1488079)
 - jQuery 1.6.4

Modified: trunk/roundcubemail/program/steps/mail/check_recent.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/check_recent.inc	2011-09-16 17:54:07 UTC (rev 5227)
+++ trunk/roundcubemail/program/steps/mail/check_recent.inc	2011-09-16 19:08:07 UTC (rev 5228)
@@ -34,10 +34,16 @@
 
 // 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 @@
         $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 @@
             $OUTPUT->command('update_selection');
         }
     }
-    else {
-        rcmail_send_unread_count($mbox_name, true);
-    }
 }
 
 $RCMAIL->plugins->exec_hook('keep_alive', array());

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list