fix channel character detect, add double prefix support for when webtv user does /join #channel

This commit is contained in:
zefie
2025-06-22 13:15:43 -04:00
parent 4e3e1af6e1
commit e1ec7a8942

View File

@@ -1806,14 +1806,15 @@ class WTVIRC {
for (var ch of channels) {
// Simulate a JOIN command for each channel
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`);
return;
}
if (i == 0) {
continue;
if (this.channelprefixes.includes(ch[1])) {
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`);
return;
}