From 1f8cc37302e254c9ac7263d3eedd1ed6a94cbb96 Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 9 Sep 2006 01:55:15 +0000 Subject: [PATCH] fix handling of LIST/LSUB in IMAP darcs-hash:20060909015515-5007d-4be7a93d5c436681acdc12ddd50edad0474ae799.gz --- src/org/ibex/mail/protocol/IMAP.java | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/org/ibex/mail/protocol/IMAP.java b/src/org/ibex/mail/protocol/IMAP.java index 9730436..22ff402 100644 --- a/src/org/ibex/mail/protocol/IMAP.java +++ b/src/org/ibex/mail/protocol/IMAP.java @@ -138,17 +138,21 @@ public class IMAP { for(int i=0; i 0 ? sep+"" : "") + s; if (mailbox(kid, false) == null) continue; - boolean phantom = mailbox(kid, false).phantom(); - while(true) { - if (pre.length() == 0) { - if (s.length() == 0) client.list(sep, kid, lsub, phantom); - } else switch(pre.charAt(0)) { - case sep: if (s.length() == 0) list(kid, pre.substring(1), lsub); break; - case '%': client.list(sep,kid,lsub,phantom);pre=pre.substring(1); s = ""; continue; - case '*': client.list(sep,kid,lsub,phantom);list(kid,pre,lsub);pre=pre.substring(1); break; - default: if (s.length()==0) break; - if (s.charAt(0) != pre.charAt(0)) break; - s = s.substring(1); pre = pre.substring(1); continue; + Mailbox phant = mailbox(kid, false, false); + if (phant != null) { + boolean phantom = phant.phantom(); + while(true) { + if (pre.length() == 0) { + if (s.length() == 0) client.list(sep, kid, lsub, phantom); + } else switch(pre.charAt(0)) { + case sep: if (s.length() == 0) list(kid, pre.substring(1), lsub); break; + case '%': client.list(sep,kid,lsub,phantom);pre=pre.substring(1); s = ""; continue; + case '*': client.list(sep,kid,lsub,phantom);list(kid,pre,lsub);pre=pre.substring(1); break; + default: if (s.length()==0) break; + if (s.charAt(0) != pre.charAt(0)) break; + s = s.substring(1); pre = pre.substring(1); continue; + } + break; } } } -- 1.7.10.4