Skip to content

Commit 4c58662

Browse files
committed
Update raws 903 and 904
1 parent c42f7e3 commit 4c58662

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

bouncer.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,18 @@ function clientConnect(socket) {
862862
continue;
863863
}
864864

865-
if(SASL && data[1]=="903") {
866-
this.write("CAP END\n");
867-
continue;
865+
// :irc.server 904 <nick> :SASL authentication failed
866+
if(data[1]=="904") {
867+
if(!this.authenticated) {
868+
this.end();
869+
}
870+
}
871+
872+
// :x 903 y :SASL authentication successful
873+
if(data[1]=="903") {
874+
if(!this.authenticated) {
875+
this.write("CAP END\n");
876+
}
868877
}
869878

870879
let s = (data[2]=="JOIN" || data[2]=="PART" || data[2]=="QUIT" || data[2]=="MODE" || data[2]=="PING" || data[2]=="NICK" || data[2]=="KICK" ? data[2] : data[1]);
@@ -1251,7 +1260,7 @@ function clientConnect(socket) {
12511260
}
12521261
break;
12531262
}
1254-
if(data[1] == "PING") {
1263+
if(data[1] == "PING") {
12551264
this.write("PONG "+data[2].substr(1).trim()+"\n");
12561265
continue;
12571266
}
@@ -1295,7 +1304,7 @@ function clientConnect(socket) {
12951304
this.parents[x].end();
12961305
}
12971306
this.buffers=false;
1298-
delete connections[hash(this.nick+this.password+this.server+this.port.toString())];
1307+
delete connections[hash(this.nick+this.password+this.server+this.port.toString())];
12991308
this.destroy();
13001309
});
13011310
connection.on('error', function(err) {

0 commit comments

Comments
 (0)