From f26e709a4b3261af363b66d99d3a09e695bb4162 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Wed, 17 Sep 2014 22:07:58 +0200 Subject: [PATCH] Let prebinding take precedence over keepalive. --- converse.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/converse.js b/converse.js index 19fa498be..2423a7f08 100644 --- a/converse.js +++ b/converse.js @@ -4501,6 +4501,12 @@ } this.connection = new Strophe.Connection(this.bosh_service_url); + if (this.prebind) { + if ((!this.jid) || (!this.sid) || (!this.rid) || (!this.bosh_service_url)) { + throw('If you set prebind=true, you MUST supply JID, RID and SID values'); + } + this.connection.attach(this.jid, this.sid, this.rid, this.onConnect); + } if (this.keepalive) { rid = this.session.get('rid'); sid = this.session.get('sid'); @@ -4513,12 +4519,6 @@ return; } } - if (this.prebind) { - if ((!this.jid) || (!this.sid) || (!this.rid) || (!this.bosh_service_url)) { - throw('If you set prebind=true, you MUST supply JID, RID and SID values'); - } - this.connection.attach(this.jid, this.sid, this.rid, this.onConnect); - } } };