This commit is contained in:
zefie
2025-06-17 21:15:23 -04:00
parent d31f83f03f
commit 2c515ed8fb

View File

@@ -879,7 +879,6 @@ class WTVIRC {
let modeMsg = `:${nickname}!${username}@${hostname} MODE ${targetChannel} `; let modeMsg = `:${nickname}!${username}@${hostname} MODE ${targetChannel} `;
let addingFlag = false; let addingFlag = false;
let prevAdding = false;
let paramIndex = 4; // Start after the modes let paramIndex = 4; // Start after the modes
let params = 0; let params = 0;
let flags = []; let flags = [];
@@ -891,12 +890,10 @@ class WTVIRC {
if (mc === '+') { if (mc === '+') {
addingFlag = true; addingFlag = true;
modeMsg += '+'; modeMsg += '+';
prevAdding = true;
continue; continue;
} else if (mc === '-') { } else if (mc === '-') {
addingFlag = false; addingFlag = false;
modeMsg += '-'; modeMsg += '-';
prevAdding = false;
continue; continue;
} }
modeStr += mc; modeStr += mc;
@@ -906,8 +903,8 @@ class WTVIRC {
flags.push(plusminus + mc); flags.push(plusminus + mc);
params++; params++;
} else { } else {
var channelmodes = this.channelmodes.get(targetChannel) || []; var channelmodes = this.channelmodes.get(targetChannel);
if (channelmodes === true) { if (!channelmodes || channelmodes === true) {
channelmodes = []; channelmodes = [];
} }
if (addingFlag) { if (addingFlag) {
@@ -1057,7 +1054,7 @@ class WTVIRC {
} }
modeMsg += '\r\n'; modeMsg += '\r\n';
this.broadcastChannel(targetChannel, modeMsg); this.broadcastChannel(targetChannel, modeMsg);
this.broadcastToAllServers(modeMsg, socket); this.broadcastToAllServers(line, socket);
} }
break; break;
} }
@@ -1304,8 +1301,10 @@ class WTVIRC {
} }
this.usermodes.set(targetNickname, usermodes); this.usermodes.set(targetNickname, usermodes);
} }
} }
targetSocket.write(`:${socket.servername} MODE ${targetSocket.nickname} ${modes.join('')}\r\n`); var username = this.usernames.get(nickname);
var hostname = this.hostnames.get(nickname);
targetSocket.write(`:${nickname}!${username}@${hostname} MODE ${targetSocket.nickname} ${modes.join('')}\r\n`);
this.broadcastToAllServers(`:${sourceUniqueId} SVSMODE ${targetUniqueId} ${modes.join('')}\r\n`, socket); this.broadcastToAllServers(`:${sourceUniqueId} SVSMODE ${targetUniqueId} ${modes.join('')}\r\n`, socket);
break; break;
default: default:
@@ -2098,7 +2097,7 @@ class WTVIRC {
} }
} }
if ((this.channelvoices.get(ch) || new Set()).has(socket.nickname)) { if ((this.channelvoices.get(ch) || new Set()).has(socket.nickname)) {
if (socket.client_caps.includes('multi-prefix')) { if (socket.client_caps.includes('multi-prefix')) {'
prefix += '+'; prefix += '+';
} else { } else {
if (!prefix) { if (!prefix) {
@@ -3496,8 +3495,7 @@ class WTVIRC {
this.broadcastToAllServers(`:${socket.uniqueId} MODE ${channel} +m\r\n`); this.broadcastToAllServers(`:${socket.uniqueId} MODE ${channel} +m\r\n`);
} }
return; return;
} else if (mode.startsWith('-m')) { } else if (mode.startsWith('-m')) {
var chan_modes = this.channelmodes.get(channel); var chan_modes = this.channelmodes.get(channel);
if (!chan_modes || chan_modes === true) { if (!chan_modes || chan_modes === true) {
chan_modes = []; chan_modes = [];