From fa59965b41023095d4da710a72ce71bb230de1eb Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 18 Jul 2011 13:35:12 -0400
Subject: [PATCH] Asynchronously load contacts after page load

---
 program/include/rcube_imap.php |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index c2a4a0d..710a434 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -83,16 +83,14 @@
 
     /**
      * All (additional) headers used (in any way) by Roundcube
-     * Not listed here: DATE, FROM, TO, SUBJECT, CONTENT-TYPE, LIST-POST
+     * Not listed here: DATE, FROM, TO, CC, REPLY-TO, SUBJECT, CONTENT-TYPE, LIST-POST
      * (used for messages listing) are hardcoded in rcube_imap_generic::fetchHeaders()
      *
      * @var array
      * @see rcube_imap::fetch_add_headers
      */
     private $all_headers = array(
-        'REPLY-TO',
         'IN-REPLY-TO',
-        'CC',
         'BCC',
         'MESSAGE-ID',
         'CONTENT-TRANSFER-ENCODING',
@@ -3510,12 +3508,25 @@
                     foreach ($ns as $item) {
                         if ($item[0] === $mbox) {
                             $options['is_root'] = true;
-                            break;
+                            break 2;
                         }
                     }
                 }
             }
         }
+        // check if the folder is other user virtual-root
+        if (!$options['is_root'] && !empty($namespace) && !empty($namespace['other'])) {
+            $parts = explode($this->delimiter, $mailbox);
+            if (count($parts) == 2) {
+                $mbox = $parts[0] . $this->delimiter;
+                foreach ($namespace['other'] as $item) {
+                    if ($item[0] === $mbox) {
+                        $options['is_root'] = true;
+                        break;
+                    }
+                }
+            }
+        }
 
         $options['name']      = $mailbox;
         $options['options']   = $this->mailbox_options($mailbox, true);

--
Gitblit v1.9.1