mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-26 13:01:06 -05:00
feat: #36 adds optional ignoreOnAbuse configuration property at channel level
This commit is contained in:
parent
f0dce70427
commit
41a9bd5eaa
@ -98,6 +98,8 @@ conf.registerChannelValue(ChanTracker, 'modesToAsk',
|
|||||||
conf.registerChannelValue(ChanTracker, 'modesToAskWhenOpped',
|
conf.registerChannelValue(ChanTracker, 'modesToAskWhenOpped',
|
||||||
registry.CommaSeparatedListOfStrings(['e', 'I'], """list of channel modes to sync into the bot's tracking database when it is opped"""))
|
registry.CommaSeparatedListOfStrings(['e', 'I'], """list of channel modes to sync into the bot's tracking database when it is opped"""))
|
||||||
|
|
||||||
|
conf.registerChannelValue(ChanTracker, 'ignoreOnAbuse',
|
||||||
|
registry.Boolean(False, """adds abusers on ignore for the punishment period"""))
|
||||||
|
|
||||||
## related to ban tracking
|
## related to ban tracking
|
||||||
|
|
||||||
|
@ -4599,6 +4599,10 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
# protection features
|
# protection features
|
||||||
def _act(self, irc, channel, mode, mask, duration, reason, nick):
|
def _act(self, irc, channel, mode, mask, duration, reason, nick):
|
||||||
log.info('ChanTracker: acting in %s against %s / %s : %s %s %s' % (channel, nick, mask, mode, duration, reason))
|
log.info('ChanTracker: acting in %s against %s / %s : %s %s %s' % (channel, nick, mask, mode, duration, reason))
|
||||||
|
if self.registryValue('ignoreOnAbuse', channel=channel, network=irc.network):
|
||||||
|
c = ircdb.channels.getChannel(channel)
|
||||||
|
c.addIgnore(mask, time.time() + duration)
|
||||||
|
ircdb.channels.setChannel(channel, c)
|
||||||
if mode == 'D':
|
if mode == 'D':
|
||||||
action = self.registryValue('modeD')
|
action = self.registryValue('modeD')
|
||||||
if len(action):
|
if len(action):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user