1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

Use executeSimpleCommand() for UID COPY so the response type is checked

The previous code never failed e.g. on a "NO" response. That lead to
messages being deleted for a move action.
This commit is contained in:
cketti 2012-09-14 02:08:39 +02:00
parent 93be25bf37
commit 2ee3378eef

View File

@ -1138,14 +1138,12 @@ public class ImapStore extends Store {
String remoteDestName = encodeString(encodeFolderName(iFolder.getPrefixedName())); String remoteDestName = encodeString(encodeFolderName(iFolder.getPrefixedName()));
//TODO: Split this into multiple commands if the command exceeds a certain length. //TODO: Split this into multiple commands if the command exceeds a certain length.
mConnection.sendCommand(String.format("UID COPY %s %s", List<ImapResponse> responses = executeSimpleCommand(String.format("UID COPY %s %s",
Utility.combine(uids, ','), Utility.combine(uids, ','),
remoteDestName), false); remoteDestName));
ImapResponse response;
do { // Get the tagged response for the UID COPY command
response = mConnection.readResponse(); ImapResponse response = responses.get(responses.size() - 1);
handleUntaggedResponse(response);
} while (response.mTag == null);
Map<String, String> uidMap = null; Map<String, String> uidMap = null;
if (response.size() > 1) { if (response.size() > 1) {
@ -2659,7 +2657,7 @@ public class ImapStore extends Store {
public List<ImapResponse> executeSimpleCommand(String command) throws IOException, public List<ImapResponse> executeSimpleCommand(String command) throws IOException,
ImapException, MessagingException { ImapException, MessagingException {
return executeSimpleCommand(command, false); return executeSimpleCommand(command, false, null);
} }
public List<ImapResponse> executeSimpleCommand(String command, boolean sensitive) throws IOException, public List<ImapResponse> executeSimpleCommand(String command, boolean sensitive) throws IOException,