Misc: Fix ignoring of user flooding with invalid commands in private.

This commit is contained in:
Valentin Lorentz 2013-04-20 08:19:16 +00:00
parent 390af5d049
commit d8df5cc650
2 changed files with 4 additions and 3 deletions

View File

@ -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:':

View File

@ -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 = '*'