diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-08-13 23:26:16 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-08-13 23:26:16 +0200 |
commit | fb77aa9153b082ae72513e5ba372e9c90a7a6f3e (patch) | |
tree | 31eb144a2f9972fd662cfd5264bd8b31eab87689 /src/main/java/de/pixart/messenger/entities/Account.java | |
parent | 8246154a36321b2d45a5e1df3caf6e6b124f4720 (diff) |
no automatic reconnect on registration failures
Diffstat (limited to 'src/main/java/de/pixart/messenger/entities/Account.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Account.java | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Account.java b/src/main/java/de/pixart/messenger/entities/Account.java index 3cb5e027f..514ea6c94 100644 --- a/src/main/java/de/pixart/messenger/entities/Account.java +++ b/src/main/java/de/pixart/messenger/entities/Account.java @@ -111,45 +111,55 @@ public class Account extends AbstractEntity { } public enum State { - DISABLED, - OFFLINE, - CONNECTING, - ONLINE, - NO_INTERNET, - UNAUTHORIZED(true), - SERVER_NOT_FOUND(true), - REGISTRATION_FAILED(true), - REGISTRATION_WEB(true), - REGISTRATION_CONFLICT(true), - REGISTRATION_SUCCESSFUL, - REGISTRATION_NOT_SUPPORTED(true), - TLS_ERROR(true), - INCOMPATIBLE_SERVER(true), - TOR_NOT_AVAILABLE(true), - DOWNGRADE_ATTACK(true), - SESSION_FAILURE(true), - BIND_FAILURE(true), - HOST_UNKNOWN(true), - REGISTRATION_PLEASE_WAIT(true), - STREAM_ERROR(true), - POLICY_VIOLATION(true), - REGISTRATION_PASSWORD_TOO_WEAK(true), - PAYMENT_REQUIRED(true), - MISSING_INTERNET_PERMISSION(true), + DISABLED(false, false), + OFFLINE(false), + CONNECTING(false), + ONLINE(false), + NO_INTERNET(false), + UNAUTHORIZED, + SERVER_NOT_FOUND, + REGISTRATION_SUCCESSFUL(false), + REGISTRATION_FAILED(true, false), + REGISTRATION_WEB(true, false), + REGISTRATION_CONFLICT(true, false), + REGISTRATION_NOT_SUPPORTED(true, false), + REGISTRATION_PLEASE_WAIT(true, false), + REGISTRATION_PASSWORD_TOO_WEAK(true, false), + TLS_ERROR, + INCOMPATIBLE_SERVER, + TOR_NOT_AVAILABLE, + DOWNGRADE_ATTACK, + SESSION_FAILURE, + BIND_FAILURE, + HOST_UNKNOWN, + STREAM_ERROR, + POLICY_VIOLATION, + PAYMENT_REQUIRED, + MISSING_INTERNET_PERMISSION(false), NETWORK_IS_UNREACHABLE(false); private final boolean isError; + private final boolean attemptReconnect; public boolean isError() { return this.isError; } + public boolean isAttemptReconnect() { + return this.attemptReconnect; + } + State(final boolean isError) { + this(isError, true); + } + + State(final boolean isError, final boolean reconnect) { this.isError = isError; + this.attemptReconnect = reconnect; } State() { - this(false); + tthis(true, true); } public int getReadableId() { |