Skip to content

Commit 5827c42

Browse files
committed
Update bouncer.js
1 parent 1c21d0b commit 5827c42

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bouncer.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ server = doServer(tlsOptions,function(socket) {
191191
this.irc.realname=null;
192192
this.irc.serverpassword=null;
193193
this.irc.nickpassword=null;
194+
this.irc.accountsasl=null;
194195
origin = commands[1].trim().split("/");
195196
if(origin[0].indexOf("||")>0)
196197
this.irc.password = origin[0].split("||")[1];
@@ -213,7 +214,7 @@ server = doServer(tlsOptions,function(socket) {
213214
}
214215
}
215216
else {
216-
if(origin.length!=2 && origin.length!=3)
217+
if(origin.length!=2 && origin.length!=3 && origin.length!=4)
217218
this.end();
218219
else {
219220
_server_pass = origin[1].split("||");
@@ -228,6 +229,8 @@ server = doServer(tlsOptions,function(socket) {
228229
}
229230
if(origin[2])
230231
this.clientbuffer=origin[2].trim();
232+
if(origin[3])
233+
this.irc.accountsasl=origin[3].trim();
231234
}
232235
}
233236
}
@@ -747,7 +750,8 @@ function clientConnect(socket) {
747750
connection.nick = socket.irc.nick;
748751
connection.nick_original = socket.irc.nick;
749752
connection.password = socket.irc.password;
750-
connection.nickpassword = socket.irc.nickpassword;
753+
connection.nickpassword = socket.irc.nickpassword;
754+
connection.accountsasl = socket.irc.accountsasl;
751755
connection.user = socket.irc.user;
752756
connection.ircuser = socket.irc.user;
753757
connection.server = socket.irc.server;
@@ -854,8 +858,8 @@ function clientConnect(socket) {
854858
}
855859

856860
if(this.sasl && data[0]=="AUTHENTICATE" && data[1]=="+") {
857-
const auth_str = this.nick + '\0' +
858-
this.nick + '\0' +
861+
const auth_str = (this.accountsasl ? this.accountsasl : this.nick) + '\0' +
862+
(this.accountsasl ? this.accountsasl : this.nick) + '\0' +
859863
this.nickpassword;
860864

861865
const b = Buffer.from(auth_str, 'utf8');

0 commit comments

Comments
 (0)