Skip to content

Commit bbd2dcd

Browse files
authored
Merge pull request #69 from Madriix/master
Update bouncer.js
2 parents 1f62b35 + 86544c1 commit bbd2dcd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

bouncer.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ server = doServer(tlsOptions,function(socket) {
626626
connections[this.hash].connected=false;
627627
connections[this.hash].write("AWAY :away\n");
628628
if(BOUNCER_TIMEOUT!=0 && BOUNCER_TIMEOUT!=null) {
629-
connections[this.hash].gone=setTimeout(function(x){try{connections[x].end();}catch(e){} try{delete connections[x];}catch(e){} },BOUNCER_TIMEOUT*1000,this.hash);
629+
connections[this.hash].gone=setTimeout(()=>{connections[this.hash].end();delete connections[this.hash];},BOUNCER_TIMEOUT*1000,this.hash);
630630
}
631631
}
632632
}
@@ -681,7 +681,10 @@ function clientReconnect(socket) {
681681
_channel=connection.channels[key];
682682

683683
if (_channel && _channel.name) {
684-
socket.write("@time="+new Date().toISOString()+";msgid=back :"+connection.nick+"!"+connection.ircuser+"@"+connection.host+" JOIN :"+_channel.name+"\n");
684+
if(connection.ircv3_extendedjoin)
685+
socket.write("@time="+new Date().toISOString()+";msgid=back :"+connection.nick+"!"+connection.ircuser+"@"+connection.host+" JOIN "+_channel.name+" "+(connection.account?connection.account:'*')+" :"+connection.realname+"\n");
686+
else
687+
socket.write("@time="+new Date().toISOString()+";msgid=back :"+connection.nick+"!"+connection.ircuser+"@"+connection.host+" JOIN :"+_channel.name+"\n");
685688
} else {
686689
console.error(`${parseInt(Number(new Date()) / 1000)} Probleme bug undefined on join : ${JSON.stringify(_channel)}`);
687690
continue;
@@ -825,6 +828,7 @@ function clientConnect(socket) {
825828
connection.userhostInNames=false;
826829
connection.messagetags=false;
827830
connection.ircv3Monitor=false;
831+
connection.ircv3_extendedjoin=false;
828832

829833
// Temp Buffer
830834
connection._buffer='';
@@ -919,6 +923,9 @@ function clientConnect(socket) {
919923
if (requestingCaps.includes("sasl"))
920924
this.sasl=true;
921925

926+
if (requestingCaps.includes("extended-join"))
927+
this.ircv3_extendedjoin=true;
928+
922929
if (data[3]!=='NEW' && requestingCaps.length === 0) {
923930
this.write("CAP END\n");
924931
} else {

0 commit comments

Comments
 (0)