From 671dad4ed6fdd3f3ceab1ad8ce9995275b8aa244 Mon Sep 17 00:00:00 2001 From: Alexandre Oliveira Date: Sun, 1 Jul 2018 15:48:37 -0300 Subject: [PATCH] Stop handling CTCP messages if the sender/target is ignored --- src/plugins/irc-events/ctcp.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/plugins/irc-events/ctcp.js b/src/plugins/irc-events/ctcp.js index 5410ca0b..f97fc14e 100644 --- a/src/plugins/irc-events/ctcp.js +++ b/src/plugins/irc-events/ctcp.js @@ -21,6 +21,14 @@ module.exports = function(irc, network) { const lobby = network.channels[0]; irc.on("ctcp response", function(data) { + const shouldIgnore = network.ignoreList.some(function(entry) { + return Helper.compareHostmask(entry, data); + }); + + if (shouldIgnore) { + return; + } + let chan = network.getChannel(data.nick); if (typeof chan === "undefined") { @@ -38,6 +46,14 @@ module.exports = function(irc, network) { // Limit requests to a rate of one per second max irc.on("ctcp request", _.throttle((data) => { + const shouldIgnore = network.ignoreList.some(function(entry) { + return Helper.compareHostmask(entry, data); + }); + + if (shouldIgnore) { + return; + } + const response = ctcpResponses[data.type]; if (response) {