1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-16 06:25:06 -05:00

Merged from:

1707 | danapple0 | 2010-05-19 21:33:44 -0500 (Wed, 19 May 2010) | 7 lines
Changed paths:
   M /k9mail/trunk/src/com/fsck/k9/mail/store/ImapStore.java

After discussion with cketti, reinstate using LIST to find the path
delimeter, but only if the server does not support NAMESPACE.  Since
we've encountered non-compliant servers that freak out at the LIST
command, enclose in a try/catch structure so that failures do not
totally prevent IMAP communication.
This commit is contained in:
Daniel Applebaum 2010-05-22 15:00:38 +00:00
parent 2a802fbb80
commit 4475bcd3ea

View File

@ -84,7 +84,7 @@ public class ImapStore extends Store
private AuthType mAuthType; private AuthType mAuthType;
private volatile String mPathPrefix; private volatile String mPathPrefix;
private volatile String mCombinedPrefix = null; private volatile String mCombinedPrefix = null;
private volatile String mPathDelimeter; private volatile String mPathDelimeter = null;
private LinkedList<ImapConnection> mConnections = private LinkedList<ImapConnection> mConnections =
new LinkedList<ImapConnection>(); new LinkedList<ImapConnection>();
@ -2082,6 +2082,29 @@ public class ImapStore extends Store
mPathPrefix = ""; mPathPrefix = "";
} }
} }
if (mPathDelimeter == null)
{
try
{
List<ImapResponse> nameResponses =
executeSimpleCommand(String.format("LIST \"\" \"\""));
for (ImapResponse response : nameResponses)
{
if (response.get(0).equals("LIST"))
{
mPathDelimeter = response.getString(2);
if (K9.DEBUG)
Log.d(K9.LOG_TAG, "Got path delimeter '" + mPathDelimeter + "' for " + getLogId());
}
}
}
catch (Exception e)
{
Log.e(K9.LOG_TAG, "Unable to get path delimeter using LIST", e);
}
}
} }
catch (SSLException e) catch (SSLException e)
{ {
@ -2742,7 +2765,7 @@ public class ImapStore extends Store
} }
} }
if (K9.DEBUG) if (K9.DEBUG)
Log.d(K9.LOG_TAG, "There are " + flagSyncMsgSeqs + " messages needing flag sync for " + getLogId()); Log.d(K9.LOG_TAG, "UIDs for messages needing flag sync are " + flagSyncMsgSeqs + " for " + getLogId());
if (flagSyncMsgSeqs.size() > 0) if (flagSyncMsgSeqs.size() > 0)
{ {