Changeset 4173 in subversion


Ignore:
Timestamp:
Nov 3, 2010 10:40:35 AM (3 years ago)
Author:
alec
Message:
  • Use consistent naming (folder -> mailbox), fixed #1487101
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_imap_generic.php

    r4168 r4173  
    12751275            } 
    12761276 
    1277         if (!$this->select($folder)) { 
     1277        if (!$this->select($mailbox)) { 
    12781278            return null; 
    12791279        } 
     
    17631763    } 
    17641764 
    1765     function thread($folder, $algorithm='REFERENCES', $criteria='', $encoding='US-ASCII') 
     1765    function thread($mailbox, $algorithm='REFERENCES', $criteria='', $encoding='US-ASCII') 
    17661766    { 
    17671767        $old_sel = $this->selected; 
    17681768 
    1769             if (!$this->select($folder)) { 
     1769            if (!$this->select($mailbox)) { 
    17701770                return false; 
    17711771            } 
    17721772 
    17731773        // 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']) { 
    17751775            return array(array(), array(), array()); 
    17761776            } 
     
    19741974                // * LIST (<options>) <delimiter> <mailbox> 
    19751975                if (!$lstatus || $cmd == 'LIST' || $cmd == 'LSUB') { 
    1976                     list($opts, $delim, $folder) = $this->tokenizeResponse($response, 3); 
     1976                    list($opts, $delim, $mailbox) = $this->tokenizeResponse($response, 3); 
    19771977 
    19781978                    // Add to result array 
    19791979                    if (!$lstatus) { 
    1980                                     $folders[] = $folder; 
     1980                                    $folders[] = $mailbox; 
    19811981                    } 
    19821982                    else { 
    1983                         $folders[$folder] = array(); 
     1983                        $folders[$mailbox] = array(); 
    19841984                    } 
    19851985 
    19861986                    // Add to options array 
    19871987                    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; 
    19901990                        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)); 
    19931993                    } 
    19941994                } 
    19951995                // * STATUS <mailbox> (<result>) 
    19961996                else if ($cmd == 'STATUS') { 
    1997                     list($folder, $status) = $this->tokenizeResponse($response, 2); 
     1997                    list($mailbox, $status) = $this->tokenizeResponse($response, 2); 
    19981998 
    19991999                    for ($i=0, $len=count($status); $i<$len; $i += 2) { 
    20002000                        list($name, $value) = $this->tokenizeResponse($status, 2); 
    2001                         $folders[$folder][$name] = $value; 
     2001                        $folders[$mailbox][$name] = $value; 
    20022002                    } 
    20032003                } 
     
    22112211    } 
    22122212 
    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)), 
    22162216                self::COMMAND_NORESPONSE); 
    22172217 
     
    22272227    } 
    22282228 
    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)), 
    22322232                self::COMMAND_NORESPONSE); 
    22332233 
     
    22352235    } 
    22362236 
    2237     function clearFolder($folder) 
    2238     { 
    2239             $num_in_trash = $this->countMessages($folder); 
     2237    function clearFolder($mailbox) 
     2238    { 
     2239            $num_in_trash = $this->countMessages($mailbox); 
    22402240            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)), 
    22492249                self::COMMAND_NORESPONSE); 
    22502250 
     
    22522252    } 
    22532253 
    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)), 
    22572257                self::COMMAND_NORESPONSE); 
    22582258 
     
    22602260    } 
    22612261 
    2262     function append($folder, &$message) 
    2263     { 
    2264             if (!$folder) { 
     2262    function append($mailbox, &$message) 
     2263    { 
     2264            if (!$mailbox) { 
    22652265                    return false; 
    22662266            } 
     
    22752275 
    22762276        $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), 
    22782278            $len, ($this->prefs['literal+'] ? '+' : '')); 
    22792279 
     
    22982298 
    22992299            // Clear internal status cache 
    2300             unset($this->data['STATUS:'.$folder]); 
     2300            unset($this->data['STATUS:'.$mailbox]); 
    23012301 
    23022302                return ($this->parseResult($line, 'APPEND: ') == self::ERROR_OK); 
     
    23092309    } 
    23102310 
    2311     function appendFromFile($folder, $path, $headers=null) 
    2312     { 
    2313             if (!$folder) { 
     2311    function appendFromFile($mailbox, $path, $headers=null) 
     2312    { 
     2313            if (!$mailbox) { 
    23142314                return false; 
    23152315            } 
     
    23392339        // send APPEND command 
    23402340        $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), 
    23422342            $len, ($this->prefs['literal+'] ? '+' : '')); 
    23432343 
     
    23752375 
    23762376            // Clear internal status cache 
    2377             unset($this->data['STATUS:'.$folder]); 
     2377            unset($this->data['STATUS:'.$mailbox]); 
    23782378 
    23792379                    return ($this->parseResult($line, 'APPEND: ') == self::ERROR_OK); 
     
    23862386    } 
    23872387 
    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)) { 
    23912391            return false; 
    23922392        } 
Note: See TracChangeset for help on using the changeset viewer.