From fdfc49f5000c5cfb672e749b416fa866299d66f7 Mon Sep 17 00:00:00 2001 From: zefie Date: Fri, 20 Jun 2025 23:44:20 -0400 Subject: [PATCH] only block PRIVMSG and NOTICE from non +z when +Z, not others --- zefie_wtvp_minisrv/includes/classes/WTVIRC.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zefie_wtvp_minisrv/includes/classes/WTVIRC.js b/zefie_wtvp_minisrv/includes/classes/WTVIRC.js index ffbb53a8..a149392f 100644 --- a/zefie_wtvp_minisrv/includes/classes/WTVIRC.js +++ b/zefie_wtvp_minisrv/includes/classes/WTVIRC.js @@ -3028,7 +3028,7 @@ class WTVIRC { const channelObj = this.channelData.get(channel); for (const user of channelObj.users) { // +Z (secureonly): Restricts private message (PRIVMSG) or notice (NOTICE) reception/sending to users with a secure connection (TLS). - if (channelObj.modes.includes('Z')) { + if (channelObj.modes.includes('Z') && (message.includes('PRIVMSG') || message.includes('NOTICE'))) { const user_modes = this.getUserModes(user); if (user_modes.includes('z')) { const sock = Array.from(this.nicknames.keys()).find(s => this.nicknames.get(s) === user); @@ -3057,13 +3057,18 @@ class WTVIRC { broadcastChannelWebTV(channel, message, exceptSocket = null) { // Broadcast a message to all WebTV users in a specific channel, except the one specified + const alreadyNotified = []; if (this.channelData.has(channel)) { const channelObj = this.channelData.get(channel); for (const user of channelObj.users) { const socket = Array.from(this.nicknames.keys()).find(s => this.nicknames.get(s) === user); + if (alreadyNotified.includes(socket)) { + continue; + } // Only send to WebTV clients if (socket && socket !== exceptSocket && this.clientIsWebTV(socket)) { this.sendWebTVNoticeTo(socket, message) + alreadyNotified.push(socket); } } }