Don't open login dialog, if login has captcha

The login dialog doesn't work anyways. So it makes more sense to
show a reasonable error dialog at the moment.
This commit is contained in:
0xboobface 2018-11-02 18:32:57 +01:00
parent 9b39440190
commit 95a3e2dc79
1 changed files with 4 additions and 2 deletions

View File

@ -49,8 +49,9 @@ public class CamsodaHttpClient extends HttpClient {
JSONObject resp = new JSONObject(response.body().string());
if(resp.has("error")) {
String error = resp.getString("error");
if(Objects.equals(error, "Please confirm that you are not a robot.")) {
return loginWithDialog();
if (Objects.equals(error, "Please confirm that you are not a robot.")) {
//return loginWithDialog();
throw new IOException("CamSoda requested to solve a captcha. Please try again in a while (maybe 15 min).");
} else {
throw new IOException(resp.getString("error"));
}
@ -62,6 +63,7 @@ public class CamsodaHttpClient extends HttpClient {
}
}
@SuppressWarnings("unused")
private boolean loginWithDialog() throws IOException {
BlockingQueue<Boolean> queue = new LinkedBlockingQueue<>();