AttackProtector: Add support for KNOCK flood. Closes GH-81.

master
Valentin Lorentz 2013-05-21 17:14:07 +02:00
parent 9e9d12d56c
commit 1c1154c0bb
2 changed files with 7 additions and 0 deletions

View File

@ -101,11 +101,13 @@ conf.registerGlobalValue(AttackProtector, 'delay',
its incoming messages 'flood' on connection is an attack.""")))
kinds = {'join': ['5p10', 'ban', ''],
'knock': ['5p20', 'mode+K', ''],
'part': ['4p5', 'ban', ''],
'nick': ['7p300', 'ban', ''],
'message': ['10p20', 'kick', ''],
'kicked': ['5p60', 'kban', _('user has been kicked multiple times')],
'groupjoin': ['20p10', 'mode+i', ''],
'groupknock': ['7p20', 'mode+K', ''],
'grouppart': ['20p10', 'mode+i', ''],
'groupnick': ['20p10', 'mode+N', ''],
'groupmessage': ['100p10', 'mode+m', '']}

View File

@ -121,6 +121,9 @@ class AttackProtector(callbacks.Plugin):
if kind in ['part', 'join', 'message']:
channels = [msg.args[0]]
prefix = msg.prefix
elif kind in ['knock']:
channels = [msg.args[0]]
prefix = msg.args[2]
elif kind in ['nick']:
newNick = msg.args[0]
channels = []
@ -156,6 +159,8 @@ class AttackProtector(callbacks.Plugin):
def doJoin(self, irc, msg):
self._eventCatcher(irc, msg, 'join')
def do710(self, irc, msg):
self._eventCatcher(irc, msg, 'knock')
def doPart(self, irc, msg):
self._eventCatcher(irc, msg, 'part')
def doNick(self, irc, msg):