Update ban_enforce.py

This commit is contained in:
David Schultz 2020-10-04 19:24:45 -05:00 committed by GitHub
parent 84aa7d1bd5
commit 2d76365214
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,11 +16,12 @@ class Module(ModuleManager.BaseModule):
if mode[0] == "+" and mode[1] == "b": if mode[0] == "+" and mode[1] == "b":
bans.append(arg) bans.append(arg)
if bans:
affected = 0 affected = 0
umasks = {u.hostmask(): u for u in event["channel"].users}
defaultmax = len(event["channel"].users) // 2 defaultmax = len(event["channel"].users) // 2
realmax = event["channel"].get_setting("ban-enforce-max", defaultmax) realmax = event["channel"].get_setting("ban-enforce-max", defaultmax)
if bans:
umasks = {u.hostmask(): u for u in event["channel"].users}
for ban in bans: for ban in bans:
mask = utils.irc.hostmask_parse(ban) mask = utils.irc.hostmask_parse(ban)
matches = list(utils.irc.hostmask_match_many( matches = list(utils.irc.hostmask_match_many(