]> jfr.im git - irc/freenode/jbnc.git/commitdiff
Update bouncer.js
authorMadriix <redacted>
Wed, 1 Jun 2022 14:10:44 +0000 (16:10 +0200)
committerGitHub <redacted>
Wed, 1 Jun 2022 14:10:44 +0000 (16:10 +0200)
Fixed an issue related to reconnect on JBNC, sometimes it reads "undefined" joins as reported on https://github.com/freenode/jbnc/issues/52
With this correction I haven't seen any for 2 days.

bouncer.js

index aa3571f739645de652d70abe658d4b875728c717..f1621b57fd6d3c5d7c46694319810c88fd29562f 100644 (file)
@@ -652,7 +652,7 @@ function clientReconnect(socket) {
       if(connection.channels.hasOwnProperty(key)) {
         _channel=connection.channels[key];
 
-        if (_channel.name != "undefined" || typeof _channel.name !== 'undefined') {
+        if (_channel && _channel.name) {
           socket.write("@time="+new Date().toISOString()+";msgid=back :"+connection.nick+"!"+connection.ircuser+"@"+connection.host+" JOIN :"+_channel.name+"\n");
         } else {
           continue;