Changeset 3870bec in github
- Timestamp:
- Oct 26, 2010 9:44:39 AM (3 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- acd9bdd
- Parents:
- 10a6fc58
- Files:
-
- 4 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/main.inc (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (3 diffs)
-
program/include/rcube_imap_generic.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
ra5a4bf4 r3870bec 50 50 - Fix parent folder with unread subfolder not bold when message is open (#1487078) 51 51 - Add basic IMAP LIST's \Noselect option support 52 - Add support for selection options from LIST-EXTENDED extension (RFC 5258) 53 - Don't list subscribed but non-existent folders (#1486225) 52 54 53 55 RELEASE 0.4.2 -
program/include/main.inc
ra5a4bf4 r3870bec 1357 1357 $path .= $currentFolder; 1358 1358 1359 // Check \Noselect option 1360 if (!$virtual) { 1361 $opts = $RCMAIL->imap->mailbox_options($path); 1359 // Check \Noselect option (if options are in cache) 1360 if (!$virtual && ($opts = $RCMAIL->imap->mailbox_options($path))) { 1362 1361 $virtual = in_array('\\Noselect', $opts); 1363 1362 } -
program/include/rcube_imap.php
rfa2173c r3870bec 2817 2817 } 2818 2818 else { 2819 // retrieve list of folders from IMAP server 2820 $a_folders = $this->conn->listSubscribed($this->mod_mailbox($root), $filter); 2819 // Server supports LIST-EXTENDED, we can use selection options 2820 if ($this->get_capability('LIST-EXTENDED')) { 2821 // This will also set mailbox options, LSUB doesn't do that 2822 $a_folders = $this->conn->listMailboxes($this->mod_mailbox($root), $filter, 2823 NULL, array('SUBSCRIBED')); 2824 2825 // remove non-existent folders 2826 if (is_array($a_folders)) { 2827 foreach ($a_folders as $idx => $folder) { 2828 if ($this->conn->data['LIST'] && ($opts = $this->conn->data['LIST'][$folder]) 2829 && in_array('\\NonExistent', $opts) 2830 ) { 2831 unset($a_folders[$idx]); 2832 } 2833 } 2834 } 2835 } 2836 // retrieve list of folders from IMAP server using LSUB 2837 else { 2838 $a_folders = $this->conn->listSubscribed($this->mod_mailbox($root), $filter); 2839 } 2821 2840 } 2822 2841 … … 3122 3141 3123 3142 /** 3124 * Gets folder options from LIST /LSUBresponse, e.g. \Noselect, \Noinferiors3143 * Gets folder options from LIST response, e.g. \Noselect, \Noinferiors 3125 3144 * 3126 3145 * @param string $mbox_name Folder name 3146 * @param bool $force Set to True if options should be refreshed 3147 * Options are available after LIST command only 3127 3148 * 3128 3149 * @return array Options list 3129 3150 */ 3130 function mailbox_options($mbox_name )3151 function mailbox_options($mbox_name, $force=false) 3131 3152 { 3132 3153 $mbox = $this->mod_mailbox($mbox_name); … … 3137 3158 3138 3159 if (!is_array($this->conn->data['LIST']) || !is_array($this->conn->data['LIST'][$mbox])) { 3139 $this->conn->listMailboxes($this->mod_mailbox(''), $mbox_name); 3160 if ($force) { 3161 $this->conn->listMailboxes($this->mod_mailbox(''), $mbox_name); 3162 } 3163 else { 3164 return array(); 3165 } 3140 3166 } 3141 3167 -
program/include/rcube_imap_generic.php
r4757608 r3870bec 1827 1827 * @param string $mailbox Mailbox name 1828 1828 * @param array $status_opts (see self::_listMailboxes) 1829 * @param array $select_opts (see self::_listMailboxes) 1829 1830 * 1830 1831 * @return array List of mailboxes or hash of options if $status_opts argument … … 1832 1833 * @access public 1833 1834 */ 1834 function listMailboxes($ref, $mailbox, $status_opts=array() )1835 { 1836 return $this->_listMailboxes($ref, $mailbox, false, $status_opts );1835 function listMailboxes($ref, $mailbox, $status_opts=array(), $select_opts=array()) 1836 { 1837 return $this->_listMailboxes($ref, $mailbox, false, $status_opts, $select_opts); 1837 1838 } 1838 1839 … … 1844 1845 * @param array $status_opts (see self::_listMailboxes) 1845 1846 * 1846 * @return array List of mailboxes or hash of options if $status_op s argument1847 * @return array List of mailboxes or hash of options if $status_opts argument 1847 1848 * is non-empty. 1848 1849 * @access public … … 1850 1851 function listSubscribed($ref, $mailbox, $status_opts=array()) 1851 1852 { 1852 return $this->_listMailboxes($ref, $mailbox, true, $status_opts );1853 return $this->_listMailboxes($ref, $mailbox, true, $status_opts, NULL); 1853 1854 } 1854 1855 … … 1861 1862 * @param array $status_opts List of STATUS options (RFC5819: LIST-STATUS) 1862 1863 * Possible: MESSAGES, RECENT, UIDNEXT, UIDVALIDITY, UNSEEN 1864 * @param array $select_opts List of selection options (RFC5258: LIST-EXTENDED) 1865 * Possible: SUBSCRIBED, RECURSIVEMATCH, REMOTE 1863 1866 * 1864 1867 * @return array List of mailboxes or hash of options if $status_ops argument … … 1866 1869 * @access private 1867 1870 */ 1868 private function _listMailboxes($ref, $mailbox, $subscribed=false, $status_opts=array()) 1871 private function _listMailboxes($ref, $mailbox, $subscribed=false, 1872 $status_opts=array(), $select_opts=array()) 1869 1873 { 1870 1874 if (empty($mailbox)) { … … 1876 1880 } 1877 1881 1878 $args = array($this->escape($ref), $this->escape($mailbox)); 1882 $args = array(); 1883 1884 if (!empty($select_opts) && $this->getCapability('LIST-EXTENDED')) { 1885 $select_opts = (array) $select_opts; 1886 1887 $args[] = '(' . implode(' ', $select_opts) . ')'; 1888 } 1889 1890 $args[] = $this->escape($ref); 1891 $args[] = $this->escape($mailbox); 1879 1892 1880 1893 if (!empty($status_opts) && $this->getCapability('LIST-STATUS')) { 1881 $status_opts = array($status_opts);1894 $status_opts = (array) $status_opts; 1882 1895 $lstatus = true; 1883 1896 … … 1895 1908 list($opts, $delim, $folder) = $this->tokenizeResponse($response, 3); 1896 1909 1910 // Add to result array 1897 1911 if (!$lstatus) { 1898 1912 $folders[] = $folder; … … 1902 1916 } 1903 1917 1904 if ($cmd == 'LIST') { 1905 $this->data['LIST'][$folder] = $opts; 1918 // Add to options array 1919 if (!empty($opts)) { 1920 if (empty($this->data['LIST'][$folder])) 1921 $this->data['LIST'][$folder] = $opts; 1922 else 1923 $this->data['LIST'][$folder] = array_unique(array_merge( 1924 $this->data['LIST'][$folder], $opts)); 1906 1925 } 1907 1926 }
Note: See TracChangeset
for help on using the changeset viewer.
