Skip to content

Commit 4b28a6d

Browse files
committed
Update bouncer.js
replacing uppercase channels to lowercase
1 parent d381986 commit 4b28a6d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

bouncer.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ server = doServer(tlsOptions,function(socket) {
515515
passwords=command[2].split(",");
516516
l=0;
517517
for(m=0;m<channels.length;m++) {
518-
if(typeof connections[this.hash].channels !== 'undefined' && connections[this.hash].channels[channels[m].trim().toUpperCase()]) {
518+
if(typeof connections[this.hash].channels !== 'undefined' && connections[this.hash].channels[channels[m].trim().toLowerCase()]) {
519519
if(command[2] && l<passwords.length)
520520
l++;
521521
continue;
@@ -952,7 +952,7 @@ function clientConnect(socket) {
952952
_add = true;
953953
// walk thru modes
954954
for(i=0;i<_mode.length;i++) {
955-
let curchan=this.channels[_target.toUpperCase()];
955+
let curchan=this.channels[_target.toLowerCase()];
956956
if(_mode[i]=='+')
957957
_add=true;
958958
else if(_mode[i]=='-')
@@ -1127,7 +1127,7 @@ function clientConnect(socket) {
11271127
_channels = data[_datatemp].substr(1).trim().split(",");
11281128
for(x=0;x<_channels.length;x++) {
11291129
_channel=_channels[x];
1130-
__channel=_channel.toUpperCase();
1130+
__channel=_channel.toLowerCase();
11311131
if(_nick==this.nick) {
11321132
if(!this.channels[__channel]) {
11331133
this.channels[__channel]={};
@@ -1168,7 +1168,7 @@ function clientConnect(socket) {
11681168
}
11691169
break;
11701170
case 'TOPIC':
1171-
_target=data[2].toUpperCase().trim();
1171+
_target=data[2].toLowerCase().trim();
11721172
_topic=lines[n].substr(lines[n].substr(1).indexOf(":")+2).trim();
11731173
if(this.channels[_target]) {
11741174
this.channels[_target].topic=_topic;
@@ -1177,14 +1177,14 @@ function clientConnect(socket) {
11771177
}
11781178
break;
11791179
case '332':
1180-
_target=data[3].toUpperCase().trim();
1180+
_target=data[3].toLowerCase().trim();
11811181
_topic=lines[n].substr(lines[n].substr(1).indexOf(":")+2).trim();
11821182
if(!this.channels[_target])
11831183
this.channels[_target]={};
11841184
this.channels[_target].topic=_topic;
11851185
break;
11861186
case '333':
1187-
_channel=data[3].toUpperCase().trim();
1187+
_channel=data[3].toLowerCase().trim();
11881188
_setter=data[4].split("!")[0].trim();
11891189
_time=data[5].trim();
11901190
if(!this.channels[_channel])
@@ -1194,7 +1194,7 @@ function clientConnect(socket) {
11941194
break;
11951195
case 'KICK':
11961196
_target=(this.messagetags ? data[4].trim() : data[3].trim());
1197-
_channel=(this.messagetags ? data[3].toUpperCase().trim() : data[2].toUpperCase().trim());
1197+
_channel=(this.messagetags ? data[3].toLowerCase().trim() : data[2].toLowerCase().trim());
11981198
if(_target==this.nick) {
11991199
delete this.channels[_channel];
12001200
}
@@ -1206,7 +1206,7 @@ function clientConnect(socket) {
12061206
}
12071207
break;
12081208
case 'PART':
1209-
_target=(this.messagetags ? data[3].toUpperCase().trim() : data[2].toUpperCase().trim());
1209+
_target=(this.messagetags ? data[3].toLowerCase().trim() : data[2].toLowerCase().trim());
12101210
_sender=(this.messagetags ? data[1].substr(1).split("!")[0] : data[0].substr(1).split("!")[0]);
12111211
if(_sender==this.nick) {
12121212
delete this.channels[_target];
@@ -1234,7 +1234,7 @@ function clientConnect(socket) {
12341234
}
12351235
break;
12361236
case '353':
1237-
_channel=data[4].toUpperCase().trim();
1237+
_channel=data[4].toLowerCase().trim();
12381238
_names=lines[n].substr(1).split(" :")[1].trim().split(" ");
12391239
if(!this._getnames[_channel]) {
12401240
this._getnames[_channel]=true;
@@ -1256,7 +1256,7 @@ function clientConnect(socket) {
12561256
}
12571257
break;
12581258
case '366':
1259-
_channel=data[3].toUpperCase().trim();
1259+
_channel=data[3].toLowerCase().trim();
12601260
this._getnames[_channel]=false;
12611261
break;
12621262
case 'NICK':

0 commit comments

Comments
 (0)