Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1661ee1 authored by Daniel Applebaum's avatar Daniel Applebaum
Browse files

Reset mMessageCount before executing SELECT. Only handle untagged

responses to SELECT once.

parent f0f07c36
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -387,9 +387,10 @@ 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;