From 83aa3d262cb8fc7ecd5d854e40b00bce253e552a Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 1 Jun 2018 23:48:22 -0700 Subject: [PATCH] antispam: allow masshighlight blocking to be disabled --- plugins/antispam.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/antispam.py b/plugins/antispam.py index 331c33a..fe91136 100644 --- a/plugins/antispam.py +++ b/plugins/antispam.py @@ -94,7 +94,8 @@ def _punish(irc, target, channel, reason): MASSHIGHLIGHT_DEFAULTS = { 'min_length': 50, 'min_nicks': 5, - 'reason': "Mass highlight spam is prohibited" + 'reason': "Mass highlight spam is prohibited", + 'enabled': False } def handle_masshighlight(irc, source, command, args): """Handles mass highlight attacks.""" @@ -102,6 +103,10 @@ def handle_masshighlight(irc, source, command, args): text = args['text'] mhl_settings = irc.get_service_option('antispam', 'masshighlight', MASSHIGHLIGHT_DEFAULTS) + + if not mhl_settings.get('enabled', False): + return + my_uid = sbot.uids.get(irc.name) # XXX workaround for single-bot protocols like Clientbot