Changeset 272

Show
Ignore:
Timestamp:
08/10/08 12:54:59 PM (5 months ago)
Author:
octorian
Message:

Merge of fixes

Location:
trunk/LogicMail/src/org/logicprobe/LogicMail/mail/imap
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/LogicMail/src/org/logicprobe/LogicMail/mail/imap/ImapClient.java

    r266 r272  
    325325            FolderTreeItem childItem = getFolderItem(baseFolder, resp.name, resp.canSelect); 
    326326                baseFolder.addChild(childItem); 
    327                 if(resp.hasChildren || !childrenExtension) { 
     327                if(resp.hasChildren || (!resp.noInferiors && !childrenExtension)) { 
    328328                    // The folder has children, so lets go and list them 
    329329                    if(depth+1 < globalConfig.getImapMaxFolderDepth()) { 
  • trunk/LogicMail/src/org/logicprobe/LogicMail/mail/imap/ImapProtocol.java

    r266 r272  
    659659        } 
    660660         
     661        // Workaround for mail servers that sometimes append untagged 
     662        // replies to the end of this response 
     663        int lastLineIndex = rawList.length - 1; 
     664        while(lastLineIndex > 0 && rawList[lastLineIndex].startsWith("* ")) { 
     665            lastLineIndex--; 
     666        } 
     667         
    661668        StringBuffer msgBuf = new StringBuffer(); 
    662         for(int i=1;i<rawList.length-1;i++) { 
     669        for(int i=1;i<lastLineIndex;i++) { 
    663670            msgBuf.append(rawList[i] + "\n"); 
    664671        } 
    665         String lastLine = rawList[rawList.length-1]; 
     672        String lastLine = rawList[lastLineIndex]; 
    666673        msgBuf.append(lastLine.substring(0, lastLine.lastIndexOf(')'))); 
    667674        return msgBuf.toString(); 
     
    759766    public static class ListResponse { 
    760767        public boolean hasChildren; 
     768        public boolean noInferiors; 
    761769        public boolean canSelect; 
    762770        public boolean marked; 
     
    829837            response.canSelect = !(flagStr.indexOf("\\Noselect") != -1); 
    830838            response.hasChildren = (flagStr.indexOf("\\HasChildren") != -1); 
     839            response.noInferiors = (flagStr.indexOf("\\Noinferiors") != -1); 
    831840            response.marked = (flagStr.indexOf("\\Marked") != -1); 
    832841 
     
    10621071         
    10631072        if(connection.available() > 0) { 
    1064                 System.err.println("-->connection.available() == " + connection.available()); 
    10651073                result = connection.receive(); 
    1066                 System.err.println("-->Read in "+result.length()); 
    1067                 System.err.println("-->connection.available() == " + connection.available()); 
    10681074        } 
    10691075        else {