diff options
author | alecpl <alec@alec.pl> | 2010-10-25 12:39:36 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-10-25 12:39:36 +0000 |
commit | a5a4bf46bd2e579e828989563c120f9ab2b28a32 (patch) | |
tree | e684ab8a9fcdf3f63564f52c2beecd83368ddf68 /program/include/rcube_imap.php | |
parent | 10f08e6ce02dc81dd2baa18cbe135f7352d370f4 (diff) |
- Add basic IMAP LIST's \Noselect option support (mark unselectable folders as virtual, etc.)
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r-- | program/include/rcube_imap.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php index 7fbff37f1..46427d6cf 100644 --- a/program/include/rcube_imap.php +++ b/program/include/rcube_imap.php @@ -3121,6 +3121,31 @@ class rcube_imap /** + * Gets folder options from LIST/LSUB response, e.g. \Noselect, \Noinferiors + * + * @param string $mbox_name Folder name + * + * @return array Options list + */ + function mailbox_options($mbox_name) + { + $mbox = $this->mod_mailbox($mbox_name); + + if ($mbox == 'INBOX') { + return array(); + } + + if (!is_array($this->conn->data['LIST']) || !is_array($this->conn->data['LIST'][$mbox])) { + $this->conn->listMailboxes($this->mod_mailbox(''), $mbox_name); + } + + $opts = $this->conn->data['LIST'][$mbox]; + + return is_array($opts) ? $opts : array(); + } + + + /** * Get message header names for rcube_imap_generic::fetchHeader(s) * * @return string Space-separated list of header names |