Skip to content

Commit 827ffbb

Browse files
authored
Merge pull request #27 from Madriix/master
Update bouncer.js
2 parents dcabb08 + cf55e32 commit 827ffbb

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

bouncer.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,15 @@ server = doServer(tlsOptions,function(socket) {
222222
}
223223
else if(commands[1]) {
224224
this.irc.nick=commands[1].trim();
225-
if(this.irc.user) {
225+
/*if(this.irc.user) {
226226
this.hash=hash(this.irc.nick+this.irc.user+this.irc.password+this.irc.server+this.irc.port.toString());
227227
if(connections[socket.hash]) {
228228
clientReconnect(this);
229229
}
230230
else {
231231
clientConnect(this);
232232
}
233-
}
233+
}*/
234234
}
235235
break;
236236
case 'USER':
@@ -446,9 +446,11 @@ server = doServer(tlsOptions,function(socket) {
446446
break;
447447
case 'QUIT':
448448
this.write(":*jbnc NOTICE * :Sayonara.\n");
449-
connections[this.hash].write("QUIT :jbnc gateway\n");
450-
connections[this.hash].end();
451-
delete connections[this.hash];
449+
if (typeof connections[this.hash] !== 'undefined') {
450+
connections[this.hash].write("QUIT :jbnc gateway\n");
451+
connections[this.hash].end();
452+
delete connections[this.hash];
453+
}
452454
break;
453455
case 'PASS':
454456
if(command[3]) {
@@ -612,8 +614,12 @@ function clientReconnect(socket) {
612614
socket.write("@time=null;msgid=null :"+connection.nick+"!"+connection.ircuser+"@"+connection.host+" JOIN :"+_channel.name+"\n");
613615
_mode_params='';
614616

615-
if ( typeof _channel.modes === 'undefined' )
616-
_channel.modes = "";
617+
if ( typeof _channel.modes === 'undefined' )
618+
_channel.modes = "";
619+
620+
if ( typeof _channel.topic === 'undefined' )
621+
_channel.topic = "";
622+
617623

618624
for(x=0;x<_channel.modes.length;x++) {
619625
switch(_channel.modes[x]) {

0 commit comments

Comments
 (0)