From 63605b65b6436181c1a24a465231ad5375ed58d9 Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 1 Dec 2011 06:30:47 +0100 Subject: [PATCH] Add support for new auto-detect namespace setting to ImapStore --- src/com/fsck/k9/mail/store/ImapStore.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index 82b858101..2c9f2371e 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -226,8 +226,8 @@ public class ImapStore extends Store { pathPrefix = cleanPath.substring(2); } } else { - pathPrefix = cleanPath; - if (pathPrefix.length() > 0) { + if (cleanPath.length() > 0) { + pathPrefix = cleanPath; autoDetectNamespace = false; } } @@ -479,7 +479,8 @@ public class ImapStore extends Store { mUsername = settings.username; mPassword = settings.password; - mPathPrefix = settings.pathPrefix; + // Make extra sure mPathPrefix is null if "auto-detect namespace" is configured + mPathPrefix = (settings.autoDetectNamespace) ? null : settings.pathPrefix; mModifiedUtf7Charset = new CharsetProvider().charsetForName("X-RFC-3501"); }