Reset mMessageCount before executing SELECT. Only handle untagged

responses to SELECT once.
This commit is contained in:
Daniel Applebaum 2009-04-21 05:34:57 +00:00
parent f0f07c36de
commit d1661ee1f5
1 changed files with 3 additions and 3 deletions

View File

@ -386,10 +386,11 @@ public class ImapStore extends Store {
}
String command = String.format("SELECT \"%s\"",
encodeFolderName(getPrefixedName()));
mMessageCount = -1;
List<ImapResponse> responses = executeSimpleCommand(command);
mMessageCount = -1;
/*
* If the command succeeds we expect the folder has been opened read-write
* unless we are notified otherwise in the responses.
@ -397,7 +398,6 @@ public class ImapStore extends Store {
mMode = OpenMode.READ_WRITE;
for (ImapResponse response : responses) {
handleUntaggedResponse(response);
if (response.mTag != null && response.size() >= 2) {
if ("[READ-ONLY]".equalsIgnoreCase(response.getString(1))) {
mMode = OpenMode.READ_ONLY;