mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-17 14:01:03 +01:00
antispam: allow masshighlight blocking to be disabled
This commit is contained in:
parent
62fcdf880c
commit
83aa3d262c
@ -94,7 +94,8 @@ def _punish(irc, target, channel, reason):
|
|||||||
MASSHIGHLIGHT_DEFAULTS = {
|
MASSHIGHLIGHT_DEFAULTS = {
|
||||||
'min_length': 50,
|
'min_length': 50,
|
||||||
'min_nicks': 5,
|
'min_nicks': 5,
|
||||||
'reason': "Mass highlight spam is prohibited"
|
'reason': "Mass highlight spam is prohibited",
|
||||||
|
'enabled': False
|
||||||
}
|
}
|
||||||
def handle_masshighlight(irc, source, command, args):
|
def handle_masshighlight(irc, source, command, args):
|
||||||
"""Handles mass highlight attacks."""
|
"""Handles mass highlight attacks."""
|
||||||
@ -102,6 +103,10 @@ def handle_masshighlight(irc, source, command, args):
|
|||||||
text = args['text']
|
text = args['text']
|
||||||
mhl_settings = irc.get_service_option('antispam', 'masshighlight',
|
mhl_settings = irc.get_service_option('antispam', 'masshighlight',
|
||||||
MASSHIGHLIGHT_DEFAULTS)
|
MASSHIGHLIGHT_DEFAULTS)
|
||||||
|
|
||||||
|
if not mhl_settings.get('enabled', False):
|
||||||
|
return
|
||||||
|
|
||||||
my_uid = sbot.uids.get(irc.name)
|
my_uid = sbot.uids.get(irc.name)
|
||||||
|
|
||||||
# XXX workaround for single-bot protocols like Clientbot
|
# XXX workaround for single-bot protocols like Clientbot
|
||||||
|
Loading…
x
Reference in New Issue
Block a user