only block PRIVMSG and NOTICE from non +z when +Z, not others
This commit is contained in:
@@ -3028,7 +3028,7 @@ class WTVIRC {
|
|||||||
const channelObj = this.channelData.get(channel);
|
const channelObj = this.channelData.get(channel);
|
||||||
for (const user of channelObj.users) {
|
for (const user of channelObj.users) {
|
||||||
// +Z (secureonly): Restricts private message (PRIVMSG) or notice (NOTICE) reception/sending to users with a secure connection (TLS).
|
// +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);
|
const user_modes = this.getUserModes(user);
|
||||||
if (user_modes.includes('z')) {
|
if (user_modes.includes('z')) {
|
||||||
const sock = Array.from(this.nicknames.keys()).find(s => this.nicknames.get(s) === user);
|
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) {
|
broadcastChannelWebTV(channel, message, exceptSocket = null) {
|
||||||
// Broadcast a message to all WebTV users in a specific channel, except the one specified
|
// Broadcast a message to all WebTV users in a specific channel, except the one specified
|
||||||
|
const alreadyNotified = [];
|
||||||
if (this.channelData.has(channel)) {
|
if (this.channelData.has(channel)) {
|
||||||
const channelObj = this.channelData.get(channel);
|
const channelObj = this.channelData.get(channel);
|
||||||
for (const user of channelObj.users) {
|
for (const user of channelObj.users) {
|
||||||
const socket = Array.from(this.nicknames.keys()).find(s => this.nicknames.get(s) === user);
|
const socket = Array.from(this.nicknames.keys()).find(s => this.nicknames.get(s) === user);
|
||||||
|
if (alreadyNotified.includes(socket)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// Only send to WebTV clients
|
// Only send to WebTV clients
|
||||||
if (socket && socket !== exceptSocket && this.clientIsWebTV(socket)) {
|
if (socket && socket !== exceptSocket && this.clientIsWebTV(socket)) {
|
||||||
this.sendWebTVNoticeTo(socket, message)
|
this.sendWebTVNoticeTo(socket, message)
|
||||||
|
alreadyNotified.push(socket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user