AttackProtector: Fix config validation.

master
Valentin Lorentz 2012-05-05 21:37:00 +00:00
parent 04a42e5837
commit 4dcf412f39
2 changed files with 4 additions and 3 deletions

View File

@ -62,10 +62,11 @@ XpY = internationalizeDocstring(XpY)
class Punishment(registry.String):
"""Value must be a valid punishment ('ban', 'kick', 'kban', 'mode+X',
'mode-X', 'command XXX', ...)"""
'mode-X', 'umode-X', 'command XXX', ...)"""
def set(self, s):
if s not in ('ban', 'kick', 'kban') and not s.startswith('mode+') and \
not s.startswith('mode-') and not s.startswith('command '):
not s.startswith('mode-') and not s.startswith('umode-') and \
not s.startswith('umode+') and not s.startswith('command '):
self.error()
return
self.setValue(s)

View File

@ -202,7 +202,7 @@ class AttackProtectorTestCase(ChannelPluginTestCase):
prefix=self.prefix)
self.irc.feedMsg(msg)
self.assertNotError('config plugin.AttackProtector.message.punishment '
'umode +b')
'umode+b')
return self._getIfAnswerIsEqual(ircmsgs.IrcMsg(prefix="", command="MODE",
args=(self.channel, mode, self.nick)))