Permalink
Browse files

Formating

  • Loading branch information...
1 parent 5a15154 commit 14d8a0a69dac519a000c38136d1d8e9e837e04e5 @prefiks prefiks committed Mar 14, 2012
Showing with 18 additions and 20 deletions.
  1. +9 −11 src/p1pp.js
  2. +9 −9 src/strophe/strophe.bosh.js
View
@@ -194,13 +194,14 @@ P1PP.prototype = {
// One of them is lying. Or both.
// In the meantime, a short timeout will do the trick.
var that = this;
- setTimeout(function(){that.fetchNodes(null, false)}, 100);
+ setTimeout(function(){that.fetchNodes(null, true)}, 100);
}
}
// Connection problem or reattach failed. Will attempt to reconnect after a random wait
- else if (!this.closing
- && (status === Strophe.Status.CONNFAIL
- || status === Strophe.Status.DISCONNECTED)) {
+ else if (!this.closing &&
+ (status === Strophe.Status.CONNFAIL
+ || status === Strophe.Status.DISCONNECTED))
+ {
this.connection.deleteTimedHandler(this.bosh_rebind_id);
this.rebind_delete();
//login is required. Give user code a chance to fetch jid and password
@@ -212,19 +213,16 @@ P1PP.prototype = {
that.connect();
}, retry_time);
}
- }
- else if (status === Strophe.Status.DISCONNECTED) {
+ } else if (status === Strophe.Status.DISCONNECTED) {
this.connection.reset();
this.closing = false;
this.params.on_disconnect();
- }
- // WebSocket rebind failed. Removing user data and reconnecting
- else if (status === Strophe.Status.REBINDFAILED) {
+ } else if (status === Strophe.Status.REBINDFAILED) {
+ // WebSocket rebind failed. Removing user data and reconnecting
this.rebind_delete();
this.connection = null;
this.connect();
- }
- else if (status === Strophe.Status.AUTHFAIL) {
+ } else if (status === Strophe.Status.AUTHFAIL) {
delete this.connection;
this.params.on_login_required(login_required_cb);
}
@@ -391,10 +391,10 @@ Strophe.Connection.prototype = {
/** Function: flush
* Immediately send any pending outgoing data.
- *
+ *
* Normally send() queues outgoing data until the next idle period
* (100ms), which optimizes network use in the common cases when
- * several send()s are called in succession. flush() can be used to
+ * several send()s are called in succession. flush() can be used to
* immediately send all pending data.
*/
flush: function ()
@@ -411,9 +411,9 @@ Strophe.Connection.prototype = {
* Parameters:
* (XMLElement) elem - The stanza to send.
* (Function) callback - The callback function for a successful request.
- * (Function) errback - The callback function for a failed or timed
+ * (Function) errback - The callback function for a failed or timed
* out request. On timeout, the stanza will be null.
- * (Integer) timeout - The time specified in milliseconds for a
+ * (Integer) timeout - The time specified in milliseconds for a
* timeout to occur.
*
* Returns:
@@ -487,7 +487,7 @@ Strophe.Connection.prototype = {
message: "Cannot queue non-DOMElement."
};
}
-
+
this._data.push(element);
},
@@ -570,7 +570,7 @@ Strophe.Connection.prototype = {
* boolean). When matchBare is true, the from parameter and the from
* attribute on the stanza will be matched as bare JIDs instead of
* full JIDs. To use this, pass {matchBare: true} as the value of
- * options. The default value for matchBare is false.
+ * options. The default value for matchBare is false.
*
* The return value should be saved if you wish to remove the handler
* with deleteHandler().
@@ -1183,7 +1183,7 @@ Strophe.Connection.prototype = {
if (hold) { this.hold = parseInt(hold, 10); }
var wait = bodyWrap.getAttribute('wait');
if (wait) { this.wait = parseInt(wait, 10); }
-
+
var do_sasl_plain = false;
var do_sasl_digest_md5 = false;
@@ -1383,7 +1383,7 @@ Strophe.Connection.prototype = {
*/
_quote: function (str)
{
- return '"' + str.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"';
+ return '"' + str.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"';
//" end string workaround for emacs
},
@@ -1821,4 +1821,4 @@ Strophe.Connection.prototype = {
clearTimeout(this._idleTimeout);
this._idleTimeout = setTimeout(this._onIdle.bind(this), 100);
}
-};
+};

0 comments on commit 14d8a0a

Please sign in to comment.