fix channel character detect, add double prefix support for when webtv user does /join #channel
This commit is contained in:
@@ -1806,14 +1806,15 @@ class WTVIRC {
|
|||||||
for (var ch of channels) {
|
for (var ch of channels) {
|
||||||
// Simulate a JOIN command for each channel
|
// Simulate a JOIN command for each channel
|
||||||
for (let i = 0; i < ch.length; i++) {
|
for (let i = 0; i < ch.length; i++) {
|
||||||
if (i == 0 && !this.channelprefixes.includes(ch[i])) {
|
if (i == 0 && !this.channelprefixes.includes(ch[0])) {
|
||||||
socket.write(`:${this.servername} 403 ${socket.nickname} ${ch} :No such channel\r\n`);
|
socket.write(`:${this.servername} 403 ${socket.nickname} ${ch} :No such channel\r\n`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (i == 0) {
|
if (this.channelprefixes.includes(ch[1])) {
|
||||||
continue;
|
ch = ch.slice(1); // Remove double prefix
|
||||||
}
|
}
|
||||||
if (!this.allowed_characters.includes(ch[i])) {
|
console.log(ch.slice(1))
|
||||||
|
if (!this.allowed_characters.includes(ch.slice(1))) {
|
||||||
socket.write(`:${this.servername} 403 ${socket.nickname} ${ch} :No such channel\r\n`);
|
socket.write(`:${this.servername} 403 ${socket.nickname} ${ch} :No such channel\r\n`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user