From d8df5cc6506aa3de8b57a9054fa55cc94c11096a Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 20 Apr 2013 08:19:16 +0000 Subject: [PATCH] Misc: Fix ignoring of user flooding with invalid commands in private. --- plugins/Misc/plugin.py | 2 +- src/conf.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 5800c3537..54e91b818 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -121,7 +121,7 @@ class Misc(callbacks.Plugin): if self.invalidCommands.len(msg) > maximum and \ not ircdb.checkCapability(msg.prefix, 'owner'): penalty = conf.supybot.abuse.flood.command.invalid.punishment() - banmask = banmasker(msg.prefix) + banmask = banmasker(msg.prefix, channel=None) self.log.info('Ignoring %s for %s seconds due to an apparent ' 'invalid command flood.', banmask, penalty) if tokens and tokens[0] == 'Error:': diff --git a/src/conf.py b/src/conf.py index ba5cd0699..ac8ba332e 100644 --- a/src/conf.py +++ b/src/conf.py @@ -1001,7 +1001,7 @@ class Banmask(registry.SpaceSeparatedSetOfStrings): self.error() self.__parent.setValue(self.List(v)) - def makeBanmask(self, hostmask, options=None): + def makeBanmask(self, hostmask, options=None, channel=None): """Create a banmask from the given hostmask. If a style of banmask isn't specified via options, the value of conf.supybot.protocols.irc.banmask is used. @@ -1009,7 +1009,8 @@ class Banmask(registry.SpaceSeparatedSetOfStrings): options - A list specifying which parts of the hostmask should explicitly be matched: nick, user, host. If 'exact' is given, then only the exact hostmask will be used.""" - channel = dynamic.channel + if not channel: + channel = dynamic.channel assert channel is None or ircutils.isChannel(channel) (nick, user, host) = ircutils.splitHostmask(hostmask) bnick = '*'