aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/xmpp
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-05-24 13:26:30 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-05-24 13:26:30 +0200
commitb69ab65b128dc13273cda0f81cbfcee7cfc9d1e6 (patch)
tree3cb54ceb23290a782eaedf831335d9564df1b396 /src/main/java/eu/siacs/conversations/xmpp
parentabbdf232c6f27a00edaa9af5937f9d022ad15f65 (diff)
show regitration failed try again later in UI
Diffstat (limited to 'src/main/java/eu/siacs/conversations/xmpp')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index f75f027b6..9a8a55fbd 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -183,14 +183,21 @@ public class XmppConnection implements Runnable {
account.setOption(Account.OPTION_REGISTER, false);
forceCloseSocket();
changeStatus(Account.State.REGISTRATION_SUCCESSFUL);
- } else if (packet.hasChild("error")
- && (packet.findChild("error").hasChild("conflict"))) {
- forceCloseSocket();
- changeStatus(Account.State.REGISTRATION_CONFLICT);
} else {
- forceCloseSocket();
- changeStatus(Account.State.REGISTRATION_FAILED);
- Log.d(Config.LOGTAG, packet.toString());
+ Element error = packet.findChild("error");
+ if (error != null && error.hasChild("conflict")) {
+ forceCloseSocket();
+ changeStatus(Account.State.REGISTRATION_CONFLICT);
+ } else if (error != null
+ && "wait".equals(error.getAttribute("type"))
+ && error.hasChild("resource-constraint")) {
+ forceCloseSocket();
+ changeStatus(Account.State.REGISTRATION_PLEASE_WAIT);
+ } else {
+ forceCloseSocket();
+ changeStatus(Account.State.REGISTRATION_FAILED);
+ Log.d(Config.LOGTAG, packet.toString());
+ }
}
}
};