Changeset 4173 in subversion
- Timestamp:
- Nov 3, 2010 10:40:35 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap_generic.php
r4168 r4173 1275 1275 } 1276 1276 1277 if (!$this->select($ folder)) {1277 if (!$this->select($mailbox)) { 1278 1278 return null; 1279 1279 } … … 1763 1763 } 1764 1764 1765 function thread($ folder, $algorithm='REFERENCES', $criteria='', $encoding='US-ASCII')1765 function thread($mailbox, $algorithm='REFERENCES', $criteria='', $encoding='US-ASCII') 1766 1766 { 1767 1767 $old_sel = $this->selected; 1768 1768 1769 if (!$this->select($ folder)) {1769 if (!$this->select($mailbox)) { 1770 1770 return false; 1771 1771 } 1772 1772 1773 1773 // return empty result when folder is empty and we're just after SELECT 1774 if ($old_sel != $ folder&& !$this->data['EXISTS']) {1774 if ($old_sel != $mailbox && !$this->data['EXISTS']) { 1775 1775 return array(array(), array(), array()); 1776 1776 } … … 1974 1974 // * LIST (<options>) <delimiter> <mailbox> 1975 1975 if (!$lstatus || $cmd == 'LIST' || $cmd == 'LSUB') { 1976 list($opts, $delim, $ folder) = $this->tokenizeResponse($response, 3);1976 list($opts, $delim, $mailbox) = $this->tokenizeResponse($response, 3); 1977 1977 1978 1978 // Add to result array 1979 1979 if (!$lstatus) { 1980 $folders[] = $ folder;1980 $folders[] = $mailbox; 1981 1981 } 1982 1982 else { 1983 $folders[$ folder] = array();1983 $folders[$mailbox] = array(); 1984 1984 } 1985 1985 1986 1986 // Add to options array 1987 1987 if (!empty($opts)) { 1988 if (empty($this->data['LIST'][$ folder]))1989 $this->data['LIST'][$ folder] = $opts;1988 if (empty($this->data['LIST'][$mailbox])) 1989 $this->data['LIST'][$mailbox] = $opts; 1990 1990 else 1991 $this->data['LIST'][$ folder] = array_unique(array_merge(1992 $this->data['LIST'][$ folder], $opts));1991 $this->data['LIST'][$mailbox] = array_unique(array_merge( 1992 $this->data['LIST'][$mailbox], $opts)); 1993 1993 } 1994 1994 } 1995 1995 // * STATUS <mailbox> (<result>) 1996 1996 else if ($cmd == 'STATUS') { 1997 list($ folder, $status) = $this->tokenizeResponse($response, 2);1997 list($mailbox, $status) = $this->tokenizeResponse($response, 2); 1998 1998 1999 1999 for ($i=0, $len=count($status); $i<$len; $i += 2) { 2000 2000 list($name, $value) = $this->tokenizeResponse($status, 2); 2001 $folders[$ folder][$name] = $value;2001 $folders[$mailbox][$name] = $value; 2002 2002 } 2003 2003 } … … 2211 2211 } 2212 2212 2213 function createFolder($ folder)2214 { 2215 $result = $this->execute('CREATE', array($this->escape($ folder)),2213 function createFolder($mailbox) 2214 { 2215 $result = $this->execute('CREATE', array($this->escape($mailbox)), 2216 2216 self::COMMAND_NORESPONSE); 2217 2217 … … 2227 2227 } 2228 2228 2229 function deleteFolder($ folder)2230 { 2231 $result = $this->execute('DELETE', array($this->escape($ folder)),2229 function deleteFolder($mailbox) 2230 { 2231 $result = $this->execute('DELETE', array($this->escape($mailbox)), 2232 2232 self::COMMAND_NORESPONSE); 2233 2233 … … 2235 2235 } 2236 2236 2237 function clearFolder($ folder)2238 { 2239 $num_in_trash = $this->countMessages($ folder);2237 function clearFolder($mailbox) 2238 { 2239 $num_in_trash = $this->countMessages($mailbox); 2240 2240 if ($num_in_trash > 0) { 2241 $this->delete($ folder, '1:*');2242 } 2243 return ($this->expunge($ folder) >= 0);2244 } 2245 2246 function subscribe($ folder)2247 { 2248 $result = $this->execute('SUBSCRIBE', array($this->escape($ folder)),2241 $this->delete($mailbox, '1:*'); 2242 } 2243 return ($this->expunge($mailbox) >= 0); 2244 } 2245 2246 function subscribe($mailbox) 2247 { 2248 $result = $this->execute('SUBSCRIBE', array($this->escape($mailbox)), 2249 2249 self::COMMAND_NORESPONSE); 2250 2250 … … 2252 2252 } 2253 2253 2254 function unsubscribe($ folder)2255 { 2256 $result = $this->execute('UNSUBSCRIBE', array($this->escape($ folder)),2254 function unsubscribe($mailbox) 2255 { 2256 $result = $this->execute('UNSUBSCRIBE', array($this->escape($mailbox)), 2257 2257 self::COMMAND_NORESPONSE); 2258 2258 … … 2260 2260 } 2261 2261 2262 function append($ folder, &$message)2263 { 2264 if (!$ folder) {2262 function append($mailbox, &$message) 2263 { 2264 if (!$mailbox) { 2265 2265 return false; 2266 2266 } … … 2275 2275 2276 2276 $key = $this->next_tag(); 2277 $request = sprintf("$key APPEND %s (\\Seen) {%d%s}", $this->escape($ folder),2277 $request = sprintf("$key APPEND %s (\\Seen) {%d%s}", $this->escape($mailbox), 2278 2278 $len, ($this->prefs['literal+'] ? '+' : '')); 2279 2279 … … 2298 2298 2299 2299 // Clear internal status cache 2300 unset($this->data['STATUS:'.$ folder]);2300 unset($this->data['STATUS:'.$mailbox]); 2301 2301 2302 2302 return ($this->parseResult($line, 'APPEND: ') == self::ERROR_OK); … … 2309 2309 } 2310 2310 2311 function appendFromFile($ folder, $path, $headers=null)2312 { 2313 if (!$ folder) {2311 function appendFromFile($mailbox, $path, $headers=null) 2312 { 2313 if (!$mailbox) { 2314 2314 return false; 2315 2315 } … … 2339 2339 // send APPEND command 2340 2340 $key = $this->next_tag(); 2341 $request = sprintf("$key APPEND %s (\\Seen) {%d%s}", $this->escape($ folder),2341 $request = sprintf("$key APPEND %s (\\Seen) {%d%s}", $this->escape($mailbox), 2342 2342 $len, ($this->prefs['literal+'] ? '+' : '')); 2343 2343 … … 2375 2375 2376 2376 // Clear internal status cache 2377 unset($this->data['STATUS:'.$ folder]);2377 unset($this->data['STATUS:'.$mailbox]); 2378 2378 2379 2379 return ($this->parseResult($line, 'APPEND: ') == self::ERROR_OK); … … 2386 2386 } 2387 2387 2388 function fetchStructureString($ folder, $id, $is_uid=false)2389 { 2390 if (!$this->select($ folder)) {2388 function fetchStructureString($mailbox, $id, $is_uid=false) 2389 { 2390 if (!$this->select($mailbox)) { 2391 2391 return false; 2392 2392 }
Note: See TracChangeset
for help on using the changeset viewer.
