3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-24 19:24:13 +01:00

antispam: don't kill users if they quit after previous punishments

This commit is contained in:
James Lu 2018-04-13 22:18:03 -07:00
parent dd8f9411b6
commit 3e07239db4

View File

@ -54,6 +54,10 @@ def _punish(irc, target, channel, reason):
irc.call_hooks([my_uid, 'ANTISPAM_KICK', {'channel': channel, 'text': reason, 'target': target,
'parse_as': 'KICK'}])
def _kill():
if target not in irc.users:
log.debug('(%s) antispam: not killing %s/%s; they already left', irc.name, target,
irc.get_friendly_name(target))
return
userdata = irc.users[target]
irc.kill(my_uid, target, reason)
irc.call_hooks([my_uid, 'ANTISPAM_KILL', {'target': target, 'text': reason,