Browse Source

Make sure the pong handler is always registered.

https://github.com/jcbrand/converse.js/commit/47e00ae005fc4034836595d4267953b46a869cb7
JC Brand 10 years ago
parent
commit
66420962f7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      converse.js

+ 2 - 2
converse.js

@@ -750,8 +750,8 @@
         };
 
         this.registerPingHandler = function () {
+            this.registerPongHandler();
             if (this.ping_interval > 0) {
-                this.registerPongHandler();
                 this.connection.addHandler(function () {
                     /* Handler on each stanza, saves the received date
                      * in order to ping only when needed.
@@ -767,7 +767,7 @@
                     if ((now - this.lastStanzaDate)/1000 > this.ping_interval) {
                         return this.ping();
                     }
-                    return true; 
+                    return true;
                 });
             }
         };