3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-11 12:42:34 +01:00

antispam: normalize logging format in handle_masshighlight

This commit is contained in:
James Lu 2018-06-08 17:54:32 -07:00
parent 10416013e8
commit 6085b21e48

View File

@ -149,22 +149,25 @@ def handle_masshighlight(irc, source, command, args):
if (not irc.connected.is_set()) or (not my_uid):
# Break if the network isn't ready.
log.debug("(%s) antispam: skipping processing; network isn't ready", irc.name)
log.debug("(%s) antispam.masshighlight: skipping processing; network isn't ready", irc.name)
return
elif not irc.is_channel(channel):
# Not a channel.
log.debug("(%s) antispam: skipping processing; %r is not a channel", irc.name, channel)
# Not a channel - mass highlight blocking only makes sense within channels
log.debug("(%s) antispam.masshighlight: skipping processing; %r is not a channel", irc.name, channel)
return
elif irc.is_internal_client(source):
# Ignore messages from our own clients.
log.debug("(%s) antispam: skipping processing message from internal client %s", irc.name, source)
log.debug("(%s) antispam.masshighlight: skipping processing message from internal client %s", irc.name, source)
return
elif source not in irc.users:
log.debug("(%s) antispam.masshighlight: ignoring message from non-user %s", irc.name, source)
return
elif channel not in irc.channels or my_uid not in irc.channels[channel].users:
# We're not monitoring this channel.
log.debug("(%s) antispam: skipping processing message from channel %r we're not in", irc.name, channel)
log.debug("(%s) antispam.masshighlight: skipping processing message from channel %r we're not in", irc.name, channel)
return
elif len(text) < mhl_settings.get('min_length', MASSHIGHLIGHT_DEFAULTS['min_length']):
log.debug("(%s) antispam: skipping processing message %r; it's too short", irc.name, text)
log.debug("(%s) antispam.masshighlight: skipping processing message %r; it's too short", irc.name, text)
return
# Strip :, from potential nicks