Disconnect on BYE

pull/194/merge
M66B 3 years ago
parent 86d655c98e
commit 7f67e79839

@ -558,9 +558,12 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
Response[] responses = protocol.command("SEARCH", arg); Response[] responses = protocol.command("SEARCH", arg);
if (responses.length == 0) if (responses.length == 0)
throw new ProtocolException("No response"); throw new ProtocolException("No response");
if (!responses[responses.length - 1].isOK()) if (!responses[responses.length - 1].isOK()) {
if (responses[responses.length - 1].isBYE())
protocol.disconnect();
throw new ProtocolException( throw new ProtocolException(
context.getString(R.string.title_service_auth, responses[responses.length - 1])); context.getString(R.string.title_service_auth, responses[responses.length - 1]));
}
List<Integer> msgnums = new ArrayList<>(); List<Integer> msgnums = new ArrayList<>();
for (Response response : responses) for (Response response : responses)

@ -3430,9 +3430,10 @@ class Core {
} }
} else { } else {
for (Response response : responses) for (Response response : responses)
if (response.isBYE()) if (response.isBYE()) {
protocol.disconnect();
return new MessagingException("UID FETCH", new IOException(response.toString())); return new MessagingException("UID FETCH", new IOException(response.toString()));
else if (response.isNO()) { } else if (response.isNO()) {
Log.e("UID FETCH " + response); Log.e("UID FETCH " + response);
throw new CommandFailedException(response); throw new CommandFailedException(response);
} else if (response.isBAD()) { } else if (response.isBAD()) {

@ -1712,8 +1712,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (responses.length == 0) if (responses.length == 0)
throw new ProtocolException("No response"); throw new ProtocolException("No response");
if (!responses[responses.length - 1].isOK()) if (!responses[responses.length - 1].isOK()) {
if (responses[responses.length - 1].isBYE())
protocol.disconnect();
throw new ProtocolException(responses[responses.length - 1]); throw new ProtocolException(responses[responses.length - 1]);
}
for (int i = 0; i < responses.length - 1; i++) { for (int i = 0; i < responses.length - 1; i++) {
EntityLog.log(ServiceSynchronize.this, account.name + " " + responses[i]); EntityLog.log(ServiceSynchronize.this, account.name + " " + responses[i]);

Loading…
Cancel
Save