3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

antispam: read nicks from userdata when handling QUITs (#617)

get_hostmask() doesn't work on someone who has already quit.
This commit is contained in:
James Lu 2019-07-01 14:09:49 -07:00
parent e3e0eac747
commit 4bd334e2b8

View File

@ -402,7 +402,7 @@ def handle_partquit(irc, source, command, args):
else: else:
filtered_message = pq_settings.get('quit_filter_message', PARTQUIT_DEFAULTS['quit_filter_message']) filtered_message = pq_settings.get('quit_filter_message', PARTQUIT_DEFAULTS['quit_filter_message'])
log.info('(%s) antispam: filtered quit message from %s due to part/quit filter glob %s', log.info('(%s) antispam: filtered quit message from %s due to part/quit filter glob %s',
irc.name, irc.get_hostmask(source), filterglob) irc.name, args['userdata'].nick, filterglob)
args['text'] = filtered_message args['text'] = filtered_message
break break
utils.add_hook(handle_partquit, 'PART', priority=999) utils.add_hook(handle_partquit, 'PART', priority=999)