diff -urN --exclude '*.svn*' LogicMail/LogicMail-1.0/LogicMail/src/org/logicprobe/LogicMail/conf/ImapConfig.java workspace/LogicMail/src/org/logicprobe/LogicMail/conf/ImapConfig.java
|
old
|
new
|
|
| 40 | 44 | public class ImapConfig extends AccountConfig { |
| 41 | 45 | private String sentFolder; |
| 42 | 46 | private String folderPrefix; |
| | 47 | private boolean onlySubscribedFolders; |
| 43 | 48 | |
| 44 | 49 | public ImapConfig() { |
| 45 | 50 | super(); |
| … |
… |
|
| 54 | 59 | setServerPort(143); |
| 55 | 60 | sentFolder = null; |
| 56 | 61 | folderPrefix = null; |
| | 62 | onlySubscribedFolders = false; |
| 57 | 63 | } |
| 58 | 64 | |
| 59 | 65 | public String toString() { |
| … |
… |
|
| 77 | 83 | this.folderPrefix = folderPrefix; |
| 78 | 84 | } |
| 79 | 85 | |
| | 86 | public boolean getOnlySubscribedFolders() { |
| | 87 | return onlySubscribedFolders; |
| | 88 | } |
| | 89 | |
| | 90 | public void setOnlySubscribedFolders(boolean value) { |
| | 91 | this.onlySubscribedFolders = value; |
| | 92 | } |
| | 93 | |
| 80 | 94 | public void writeConfigItems(SerializableHashtable table) { |
| 81 | 95 | super.writeConfigItems(table); |
| 82 | 96 | if(sentFolder != null) { |
| … |
… |
|
| 92 | 106 | else { |
| 93 | 107 | table.put("account_imap_folderPrefix", ""); |
| 94 | 108 | } |
| | 109 | |
| | 110 | table.put("account_imap_onlySubscribedFolders", new Integer(onlySubscribedFolders ? 1 : 0)); |
| 95 | 111 | } |
| 96 | 112 | |
| 97 | 113 | public void readConfigItems(SerializableHashtable table) { |
| … |
… |
|
| 113 | 129 | folderPrefix = null; |
| 114 | 130 | } |
| 115 | 131 | } |
| | 132 | |
| | 133 | value = table.get("account_imap_onlySubscribedFolders"); |
| | 134 | if(value != null && value instanceof Integer) { |
| | 135 | onlySubscribedFolders = (((Integer)value).intValue() == 1); |
| | 136 | } |
| 116 | 137 | } |
| 117 | 138 | } |
diff -urN --exclude '*.svn*' LogicMail/LogicMail-1.0/LogicMail/src/org/logicprobe/LogicMail/mail/imap/ImapClient.java workspace/LogicMail/src/org/logicprobe/LogicMail/mail/imap/ImapClient.java
|
old
|
new
|
|
| 59 | 63 | private ImapProtocol imapProtocol; |
| 60 | 64 | private String username; |
| 61 | 65 | private String password; |
| | 66 | private boolean onlySubscribedFolders; |
| 62 | 67 | private boolean openStarted; |
| 63 | 68 | |
| 64 | 69 | /** |
| … |
… |
|
| 95 | 100 | imapProtocol = new ImapProtocol(connection); |
| 96 | 101 | username = acctCfg.getServerUser(); |
| 97 | 102 | password = acctCfg.getServerPass(); |
| | 103 | onlySubscribedFolders = acctCfg.getOnlySubscribedFolders(); |
| 98 | 104 | openStarted = false; |
| 99 | 105 | } |
| 100 | 106 | |
| … |
… |
|
| 134 | 140 | // so the folder delim will be aquired differently. |
| 135 | 141 | if(nsPersonal == null) { |
| 136 | 142 | // Discover folder delim |
| 137 | | Vector resp = imapProtocol.executeList("", ""); |
| | 143 | Vector resp = imapProtocol.executeList("", "", false); |
| 138 | 144 | if(resp.size() > 0) { |
| 139 | 145 | folderDelim = ((ImapProtocol.ListResponse)resp.elementAt(0)).delim; |
| 140 | 146 | } |
| … |
… |
|
| 237 | 243 | |
| 238 | 244 | private void getFolderTreeImpl(FolderTreeItem baseFolder, int depth, boolean childrenExtension) throws IOException, MailException { |
| 239 | 245 | Vector respList; |
| | 246 | |
| 240 | 247 | if(depth == 0) { |
| 241 | | respList = imapProtocol.executeList(baseFolder.getPath(), "%"); |
| | 248 | respList = imapProtocol.executeList(baseFolder.getPath(), "%", onlySubscribedFolders); |
| 242 | 249 | } |
| 243 | 250 | else { |
| 244 | | respList = imapProtocol.executeList(baseFolder.getPath() + baseFolder.getDelim(), "%"); |
| | 251 | respList = imapProtocol.executeList(baseFolder.getPath() + baseFolder.getDelim(), "%", onlySubscribedFolders); |
| 245 | 252 | } |
| 246 | 253 | |
| 247 | 254 | int size = respList.size(); |
diff -urN --exclude '*.svn*' LogicMail/LogicMail-1.0/LogicMail/src/org/logicprobe/LogicMail/mail/imap/ImapProtocol.java workspace/LogicMail/src/org/logicprobe/LogicMail/mail/imap/ImapProtocol.java
|
old
|
new
|
|
| 771 | 771 | * @param mboxName Mailbox name or wildcards (i.e. "%") |
| 772 | 772 | * @return Vector of ListResponse objects |
| 773 | 773 | */ |
| 774 | | public Vector executeList(String refName, String mboxName) throws IOException, MailException { |
| | 774 | public Vector executeList(String refName, String mboxName, boolean onlySubscribedFolders) throws IOException, MailException { |
| 775 | 775 | if(EventLogger.getMinimumLevel() >= EventLogger.DEBUG_INFO) { |
| 776 | 776 | EventLogger.logEvent( |
| 777 | 777 | AppInfo.GUID, |
| … |
… |
|
| 780 | 780 | } |
| 781 | 781 | |
| 782 | 782 | String[] results; |
| 783 | | results = execute("LIST", "\""+StringParser.addEscapedChars(refName)+"\" \""+StringParser.addEscapedChars(mboxName)+"\""); |
| 784 | | |
| | 783 | String cmd = "LIST"; |
| | 784 | if (onlySubscribedFolders) { |
| | 785 | cmd = "LSUB"; |
| | 786 | } |
| | 787 | results = execute(cmd, "\""+StringParser.addEscapedChars(refName)+"\" \""+StringParser.addEscapedChars(mboxName)+"\""); |
| | 788 | |
| 785 | 789 | Vector retVec = new Vector(results.length); |
| 786 | 790 | ListResponse response; |
| 787 | 791 | String temp; |
diff -urN --exclude '*.svn*' LogicMail/LogicMail-1.0/LogicMail/src/org/logicprobe/LogicMail/ui/AcctCfgScreen.java workspace/LogicMail/src/org/logicprobe/LogicMail/ui/AcctCfgScreen.java
|
old
|
new
|
|
| 68 | 68 | private ObjectChoiceField outgoingServerField; |
| 69 | 69 | private ObjectChoiceField sentFolderChoiceField; |
| 70 | 70 | private BasicEditField folderPrefixField; |
| | 71 | private CheckboxField onlySubscribedFoldersField; |
| 71 | 72 | private ButtonField saveButton; |
| 72 | 73 | |
| 73 | 74 | private boolean acctSaved; |
| … |
… |
|
| 214 | 215 | |
| 215 | 216 | folderPrefixField = new BasicEditField("Folder prefix: ", imapConfig.getFolderPrefix()); |
| 216 | 217 | add(folderPrefixField); |
| | 218 | |
| | 219 | onlySubscribedFoldersField = new CheckboxField("Subscribed folders only", imapConfig.getOnlySubscribedFolders()); |
| | 220 | add(onlySubscribedFoldersField); |
| 217 | 221 | } |
| 218 | 222 | |
| 219 | 223 | add(new SeparatorField()); |
| … |
… |
|
| 346 | 350 | else { |
| 347 | 351 | imapConfig.setFolderPrefix(folderPrefix); |
| 348 | 352 | } |
| | 353 | |
| | 354 | imapConfig.setOnlySubscribedFolders(onlySubscribedFoldersField.getChecked()); |
| 349 | 355 | } |
| 350 | 356 | |
| 351 | 357 | acctSaved = true; |