Commit 896b147a authored by JC Brand's avatar JC Brand

Prevent converse.connection.attach from being called twice

when using prebind and keepalive together.
parent e0e0f1b7
......@@ -5332,15 +5332,6 @@
}
this.setUpXMLLogging();
if (this.prebind) {
if (this.jid && this.sid && this.rid) {
this.connection.attach(this.jid, this.sid, this.rid, this.onConnect);
}
if (!this.keepalive) {
throw("If you use prebind and don't use keepalive, "+
"then you MUST supply JID, RID and SID values");
}
}
if (this.keepalive) {
rid = this.session.get('rid');
sid = this.session.get('sid');
......@@ -5365,6 +5356,15 @@
this.connection.attach(jid, sid, rid, this.onConnect);
}
}
// Prebind without keepalive
} else if (this.prebind) {
if (this.jid && this.sid && this.rid) {
this.connection.attach(this.jid, this.sid, this.rid, this.onConnect);
} else {
throw("If you use prebind and don't use keepalive, "+
"then you MUST supply JID, RID and SID values");
}
}
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment