3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

antispam: allow masshighlight blocking to be disabled

This commit is contained in:
James Lu 2018-06-01 23:48:22 -07:00
parent 62fcdf880c
commit 83aa3d262c

View File

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