Fixing the CTCP PING
authorRamiro Bou <bouramiro@gmail.com>
Thu, 2 Oct 2014 18:44:42 +0000 (15:44 -0300)
committerRamiro Bou <bouramiro@gmail.com>
Thu, 2 Oct 2014 18:44:42 +0000 (15:44 -0300)
client/src/models/network.js

index 3e297cca0538ba45f1cd9a6234f99cde7b93f8b7..e1faf440315f9f1da368e90cc1da3cf6b5edb3e2 100644 (file)
         // Reply to a TIME ctcp
         if (event.msg.toUpperCase() === 'TIME') {
             this.gateway.ctcpResponse(event.type, event.nick, (new Date()).toString());
-        }else if(event.msg.toUpperCase().substr(1, 4) === 'PING') { // CTCP PING reply
-            this.gateway.ctcpResponse(event.type, event.nick, event.msgstr.slice(6, -1));
+        } else if(event.type.toUpperCase() === 'PING') { // CTCP PING reply
+            this.gateway.ctcpResponse(event.type, event.nick, event.msg.substr(5));
         }
     }