From 2ce8e5dd94246e9c0bd0b2dd795cc779d1ef766a Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 19 Aug 2011 04:00:09 -0400
Subject: [PATCH] - Use internal cache for mailbox_info() result

---
 program/include/rcube_imap.php |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 0e28b08..6a35af0 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -3513,6 +3513,10 @@
      */
     function mailbox_info($mailbox)
     {
+        if ($this->icache['options'] && $this->icache['options']['name'] == $mailbox) {
+            return $this->icache['options'];
+        }
+
         $acl       = $this->get_capability('ACL');
         $namespace = $this->get_namespace();
         $options   = array();
@@ -3574,6 +3578,8 @@
             $options['norename'] = $options['is_root'] || $options['namespace'] != 'personal';
         }
 
+        $this->icache['options'] = $options;
+
         return $options;
     }
 

--
Gitblit v1.9.1