From 3e07239db4a7dda07159fbf582ff7157156483ab Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 13 Apr 2018 22:18:03 -0700 Subject: [PATCH] antispam: don't kill users if they quit after previous punishments --- plugins/antispam.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/antispam.py b/plugins/antispam.py index 7ae97d8..6f48cf2 100644 --- a/plugins/antispam.py +++ b/plugins/antispam.py @@ -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,