AttackProtector: add three group detections

master
Valentin Lorentz 2010-11-28 11:13:16 +01:00
parent dfbcc1c1e3
commit c1ae33edd0
2 changed files with 7 additions and 4 deletions

View File

@ -61,7 +61,7 @@ class XpY(registry.String):
XpY = internationalizeDocstring(XpY)
class Punishment(registry.OnlySomeStrings):
validStrings = ('ban', 'kick', 'kban', 'mode+i')
validStrings = ('ban', 'kick', 'kban', 'mode+i', 'mode+N', 'mode+m')
Punishment = internationalizeDocstring(Punishment)
AttackProtector = conf.registerPlugin('AttackProtector')
@ -78,7 +78,10 @@ kinds = {'join': ['5p10', 'ban'],
'part': ['4p5', 'ban'],
'nick': ['7p300', 'ban'],
'message': ['10p20', 'kick'],
'groupjoin': ['20p10', 'mode+i']}
'groupjoin': ['20p10', 'mode+i'],
'grouppart': ['20p10', 'mode+i'],
'groupnick': ['20p10', 'mode+N'],
'groupmessage': ['100p10', 'mode+m']}
for kind in kinds:
data = kinds[kind]
conf.registerGroup(AttackProtector, kind)

View File

@ -168,8 +168,8 @@ class AttackProtector(callbacks.Plugin):
irc.queueMsg(msg)
msg = ircmsgs.ban(channel, prefix)
irc.queueMsg(msg)
elif punishment == 'mode+i':
msg = ircmsgs.mode(channel, '+i')
elif punishment.startswith('mode'):
msg = ircmsgs.mode(channel, punishment[len('mode'):])
irc.queueMsg(msg)
AttackProtector = internationalizeDocstring(AttackProtector)