aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/eu/siacs/conversations/xmpp/XmppConnection.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java
index ae6b6f72..36920929 100644
--- a/src/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -763,8 +763,13 @@ public class XmppConnection implements Runnable {
});
}
- private void processStreamError(Tag currentTag) {
- Log.d(Config.LOGTAG, "processStreamError");
+ private void processStreamError(Tag currentTag) throws XmlPullParserException, IOException {
+ Element streamError = tagReader.readElement(currentTag);
+ if (streamError!=null && streamError.hasChild("conflict")) {
+ String resource = account.getResource().split("\\.")[0];
+ account.setResource(resource+"."+nextRandomId());
+ Log.d(Config.LOGTAG,account.getJid()+": switching resource due to conflict ("+account.getResource()+")");
+ }
}
private void sendStartStream() throws IOException {