add ability to set channel forward ban on cycle detected

This commit is contained in:
Nicolas Coevoet 2014-08-28 13:53:18 +02:00
parent aaa874be23
commit d04636c322
2 changed files with 8 additions and 0 deletions

View File

@ -283,6 +283,8 @@ conf.registerChannelValue(ChanTracker, 'cycleDuration',
registry.PositiveInteger(1800,"""punishment duration in seconds"""))
conf.registerChannelValue(ChanTracker, 'cycleComment',
registry.String('cycle detected',"""comment added on mode changes database, empty for no comment"""))
conf.registerChannelValue(ChanTracker, 'cycleForward',
registry.String('',"""if your ircd supports that, you can forward the user to a specific channel"""))
# channel massJoin from an host
conf.registerChannelValue(ChanTracker, 'massJoinPermit',

View File

@ -2109,6 +2109,9 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
mode = self.registryValue('%sMode' % kind,channel=channel)
duration = self.registryValue('%sDuration' % kind,channel=channel)
comment = self.registryValue('%sComment' % kind,channel=channel)
forward = self.registryValue('cycleForward',channel=channel)
if kind == 'cycle' and len(forward):
best = best + '$' + forward
self._act(irc,channel,mode,best,duration,comment)
self.forceTickle = True
if canRemove:
@ -2254,6 +2257,9 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
mode = self.registryValue('%sMode' % kind,channel=channel)
duration = self.registryValue('%sDuration' % kind,channel=channel)
comment = self.registryValue('%sComment' % kind,channel=channel)
forward = self.registryValue('cycleForward',channel=channel)
if kind == 'cycle' and len(forward):
best = best + '$' + forward
self._act(irc,channel,mode,best,duration,comment)
self.forceTickle = True
if removeNick: