summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap_generic.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-10-25 12:39:36 +0000
committeralecpl <alec@alec.pl>2010-10-25 12:39:36 +0000
commita5a4bf46bd2e579e828989563c120f9ab2b28a32 (patch)
treee684ab8a9fcdf3f63564f52c2beecd83368ddf68 /program/include/rcube_imap_generic.php
parent10f08e6ce02dc81dd2baa18cbe135f7352d370f4 (diff)
- Add basic IMAP LIST's \Noselect option support (mark unselectable folders as virtual, etc.)
Diffstat (limited to 'program/include/rcube_imap_generic.php')
-rw-r--r--program/include/rcube_imap_generic.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 9009d125d..d51b8cfbe 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -857,6 +857,12 @@ class rcube_imap_generic
return true;
}
+ if (is_array($this->data['LIST']) && is_array($opts = $this->data['LIST'][$mailbox])) {
+ if (in_array('\\Noselect', $opts)) {
+ return false;
+ }
+ }
+
list($code, $response) = $this->execute('SELECT', array($this->escape($mailbox)));
if ($code == self::ERROR_OK) {
@@ -1861,11 +1867,11 @@ class rcube_imap_generic
if (empty($mailbox)) {
$mailbox = '*';
}
-/*
+
if (empty($ref) && $this->prefs['rootdir']) {
$ref = $this->prefs['rootdir'];
}
-*/
+
$args = array($this->escape($ref), $this->escape($mailbox));
if (!empty($status_opts) && $this->getCapability('LIST-STATUS')) {
@@ -1884,12 +1890,17 @@ class rcube_imap_generic
// * LIST (<options>) <delimiter> <mailbox>
if (!$lstatus || $cmd == 'LIST' || $cmd == 'LSUB') {
list($opts, $delim, $folder) = $this->tokenizeResponse($response, 3);
+
if (!$lstatus) {
$folders[] = $folder;
}
else {
$folders[$folder] = array();
}
+
+ if ($cmd == 'LIST') {
+ $this->data['LIST'][$folder] = $opts;
+ }
}
// * STATUS <mailbox> (<result>)
else if ($cmd == 'STATUS') {