mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Only set username and password in the irc options if they are actually set in serverConfig
This commit is contained in:
parent
bb43dd31a0
commit
c7e1a86502
@ -65,7 +65,9 @@ module.exports = function(RED) {
|
||||
if (node.serverConfig.ircclient === null) {
|
||||
node.log(RED._("irc.errors.connect")+": "+node.serverConfig.server+" "+node.serverConfig.username+" "+node.serverConfig.ssl);
|
||||
node.status({fill:"grey",shape:"dot",text:"node-red:common.status.connecting"});
|
||||
var options = {autoConnect:true,autoRejoin:false,floodProtection:true,secure:node.serverConfig.ssl,selfSigned:node.serverConfig.cert,port:node.serverConfig.port,retryDelay:20000,userName:node.serverConfig.username,password:node.serverConfig.password};
|
||||
var options = {autoConnect:true,autoRejoin:false,floodProtection:true,secure:node.serverConfig.ssl,selfSigned:node.serverConfig.cert,port:node.serverConfig.port,retryDelay:20000};
|
||||
if (node.serverConfig.username !== null) { options["userName"] = node.serverConfig.username }
|
||||
if (node.serverConfig.password !== null) { options["password"] = node.serverConfig.password }
|
||||
node.serverConfig.ircclient = new irc.Client(node.serverConfig.server, node.serverConfig.nickname, options);
|
||||
node.serverConfig.ircclient.setMaxListeners(0);
|
||||
node.serverConfig.ircclient.addListener('error', function(message) {
|
||||
@ -200,7 +202,9 @@ module.exports = function(RED) {
|
||||
if (node.serverConfig.ircclient === null) {
|
||||
node.log(RED._("irc.errors.connect")+": "+node.serverConfig.server);
|
||||
node.status({fill:"grey",shape:"dot",text:"node-red:common.status.connecting"});
|
||||
var options = {autoConnect:true,autoRejoin:false,floodProtection:true,secure:node.serverConfig.ssl,selfSigned:node.serverConfig.cert,port:node.serverConfig.port,retryDelay:20000,userName:node.serverConfig.username,password:node.serverConfig.password};
|
||||
var options = {autoConnect:true,autoRejoin:false,floodProtection:true,secure:node.serverConfig.ssl,selfSigned:node.serverConfig.cert,port:node.serverConfig.port,retryDelay:20000};
|
||||
if (node.serverConfig.username !== null) { options['userName'] = node.serverConfig.username }
|
||||
if (node.serverConfig.password !== null) { options['password'] = node.serverConfig.password }
|
||||
node.serverConfig.ircclient = new irc.Client(node.serverConfig.server, node.serverConfig.nickname, options);
|
||||
node.serverConfig.ircclient.setMaxListeners(0);
|
||||
node.serverConfig.ircclient.addListener('error', function(message) {
|
||||
|
Loading…
Reference in New Issue
Block a user