1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-12 22:28:10 -05:00

Fix bug introduced with commit b7a6dbd973

Fixes issue 3297
This commit is contained in:
cketti 2011-05-15 16:23:53 +02:00
parent 95288b37d7
commit 41b039b691

View File

@ -377,9 +377,9 @@ public class ImapStore extends Store {
if (ImapResponseParser.equalsIgnoreCase(response.get(0), commandResponse)) { if (ImapResponseParser.equalsIgnoreCase(response.get(0), commandResponse)) {
boolean includeFolder = true; boolean includeFolder = true;
String folder; String decodedFolderName;
try { try {
folder = decodeFolderName(response.getString(3)); decodedFolderName = decodeFolderName(response.getString(3));
} catch (CharacterCodingException e) { } catch (CharacterCodingException e) {
Log.w(K9.LOG_TAG, "Folder name not correctly encoded with the UTF-7 variant " + Log.w(K9.LOG_TAG, "Folder name not correctly encoded with the UTF-7 variant " +
"as defined by RFC 3501: " + response.getString(3), e); "as defined by RFC 3501: " + response.getString(3), e);
@ -391,6 +391,8 @@ public class ImapStore extends Store {
continue; continue;
} }
String folder = decodedFolderName;
if (mPathDelimeter == null) { if (mPathDelimeter == null) {
mPathDelimeter = response.getString(2); mPathDelimeter = response.getString(2);
mCombinedPrefix = null; mCombinedPrefix = null;
@ -406,12 +408,13 @@ public class ImapStore extends Store {
*/ */
continue; continue;
} else { } else {
int prefixLength = getCombinedPrefix().length();
if (getCombinedPrefix().length() > 0) { if (prefixLength > 0) {
if (folder.length() >= getCombinedPrefix().length()) { // Strip prefix from the folder name
folder = folder.substring(getCombinedPrefix().length()); if (folder.length() >= prefixLength) {
folder = folder.substring(prefixLength);
} }
if (!folder.equalsIgnoreCase(getCombinedPrefix() + folder)) { if (!decodedFolderName.equalsIgnoreCase(getCombinedPrefix() + folder)) {
includeFolder = false; includeFolder = false;
} }
} }