Merge pull request #2609 from RockyTV/rockytv

Stop handling CTCP messages if the sender/target is ignored
This commit is contained in:
Pavel Djundik 2018-07-07 11:09:35 +03:00 committed by GitHub
commit 95e6fb3a49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {