mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-24 09:42:17 -05:00
avoiding resource conflicts
This commit is contained in:
parent
5ae62f18b4
commit
664c9c434f
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user