From 91354e90e81ee9d23633d37b18bd680bc4d459e5 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 12 Oct 2009 06:58:30 -0400
Subject: [PATCH] - performance fix in rcmail_js_message_list()

---
 program/steps/mail/func.inc |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index b220eda..bca2f8c 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -403,6 +403,13 @@
   $browser = new rcube_browser;
 
   $OUTPUT->command('set_message_coltypes', $a_show_cols);
+
+  // remove 'attachment' and 'flag' columns, we don't need them here
+  if(($key = array_search('attachment', $a_show_cols)) !== FALSE)
+    unset($a_show_cols[$key]);
+  if(($key = array_search('flag', $a_show_cols)) !== FALSE)
+    unset($a_show_cols[$key]);
+
   if ($browser->ie && $replace)
     $OUTPUT->command('offline_message_list', true);
 
@@ -416,12 +423,6 @@
       continue;
 
     $IMAP->set_charset(!empty($header->charset) ? $header->charset : $CONFIG['default_charset']);
-
-    // remove 'attachment' and 'flag' columns, we don't need them here
-    if(($key = array_search('attachment', $a_show_cols)) !== FALSE)
-      unset($a_show_cols[$key]);
-    if(($key = array_search('flag', $a_show_cols)) !== FALSE)
-      unset($a_show_cols[$key]);
 
     // format each col; similar as in rcmail_message_list()
     foreach ($a_show_cols as $col)
@@ -465,8 +466,8 @@
       $insert_top);
     }
 
-    if ($browser->ie && $replace)
-      $OUTPUT->command('offline_message_list', false);
+  if ($browser->ie && $replace)
+    $OUTPUT->command('offline_message_list', false);
   }
 
 

--
Gitblit v1.9.1