mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-25 20:41:19 -05:00
resolve #22 this new feature is only available for b,q,e,I and note commands, not automated actions
This commit is contained in:
parent
7a4ff48863
commit
0c105a03ba
@ -62,6 +62,9 @@ conf.registerGlobalValue(ChanTracker, 'resolveIp',
|
||||
|
||||
# per channel settings
|
||||
|
||||
conf.registerChannelValue(ChanTracker, 'useAccountBanIfPossible',
|
||||
registry.Boolean(False, """bot will choose account bans when user is identified, only works for b,q,e,I,note commands not automated bans"""))
|
||||
|
||||
conf.registerChannelValue(ChanTracker, 'avoidOverlap',
|
||||
registry.Boolean(False, """avoid overlap between items, bot will try to use existing items against users, some limitations with extended bans"""))
|
||||
|
||||
|
16
plugin.py
16
plugin.py
@ -1891,7 +1891,13 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
||||
n = self.getNick(irc,item)
|
||||
patterns = getBestPattern(n,irc,self.registryValue('useIpForGateway',channel=channel),self.registryValue('resolveIp'))
|
||||
if len(patterns):
|
||||
targets.append(patterns[0])
|
||||
pattern = patterns[0]
|
||||
if self.registryValue('useAccountBanIfPossible',channel=channel):
|
||||
for p in patterns:
|
||||
if p.startswith('$a:'):
|
||||
pattern = p
|
||||
break
|
||||
targets.append(pattern)
|
||||
elif ircutils.isUserHostmask(item) or self.getIrcdExtbansPrefix(irc) in item:
|
||||
targets.append(item)
|
||||
for target in targets:
|
||||
@ -2015,7 +2021,13 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
||||
if not found:
|
||||
patterns = getBestPattern(n,irc,self.registryValue('useIpForGateway',channel=channel),self.registryValue('resolveIp'))
|
||||
if len(patterns):
|
||||
targets.append(patterns[0])
|
||||
pattern = patterns[0]
|
||||
if self.registryValue('useAccountBanIfPossible',channel=channel):
|
||||
for p in patterns:
|
||||
if p.startswith('$a:'):
|
||||
pattern = p
|
||||
break
|
||||
targets.append(pattern)
|
||||
elif ircutils.isUserHostmask(item) or self.getIrcdExtbansPrefix(irc) in item:
|
||||
found = False
|
||||
if self.registryValue('avoidOverlap',channel=channel):
|
||||
|
Loading…
x
Reference in New Issue
Block a user