aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/XmppConnection.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
index fc157cf4d..09b90b3ba 100644
--- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
+++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
@@ -1074,7 +1074,13 @@ public class XmppConnection implements Runnable {
} else {
Log.d(Config.LOGTAG, account.getJid() + ": disconnecting because of bind failure (" + packet.toString());
}
- account.setResource(account.getResource().split("\\.")[0]);
+ final Element error = packet.findChild("error");
+ final String resource = account.getResource().split("\\.")[0];
+ if (packet.getType() == IqPacket.TYPE.ERROR && error != null && error.hasChild("conflict")) {
+ account.setResource(resource + "." + nextRandomId());
+ } else {
+ account.setResource(resource);
+ }
throw new StateChangingError(Account.State.BIND_FAILURE);
}
});