added debug mode 'd' for *Mode in protections

This commit is contained in:
Nicolas Coevoet 2014-06-20 22:46:06 +02:00
parent b0d9330df9
commit 498edec5e9
2 changed files with 5 additions and 0 deletions

View File

@ -155,6 +155,7 @@ Each of those detections has the same kind of settings: there is *Permit (-1 to
- b : ban the user
- k : kick the user
- r : remove (force part) the user, if the ircd has the feature. 'REMOVE $channel $nick :$reason'
- d : debug > forward action to logChannel if configured
For bans (b and q mode), you can choose the *Duration of the quiet/ban, and add a *Mark on the related quiet/ban. The 'bad' settings, when enabled (badPermit > -1) keeps track of users who did something wrong during badLife, and can end to badMode if the user exceeds the limit.

View File

@ -2821,6 +2821,10 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
# protection features
def _act (self,irc,channel,mode,mask,duration,reason):
if mode == 'd':
if self.registryValue('logChannel',channel=channel) in irc.state.channels:
self._logChan(irc,channel,'[%s] debug %s %s %s %s' % (channel,mode,mask,duration,reason)
return
if mode in self.registryValue('modesToAsk',channel=channel) or mode in self.registryValue('modesToAskWhenOpped',channel=channel):
i = self.getIrc(irc)
if i.add(irc,channel,mode,mask,duration,irc.prefix,self.getDb(irc.network)):