mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-28 22:41:05 -05:00
Fix regression from repeat protection rework.
This commit is contained in:
parent
dc0615a29a
commit
8d0d64e843
26
plugin.py
26
plugin.py
@ -1607,8 +1607,7 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
f = self._logChan
|
f = self._logChan
|
||||||
if be:
|
if be:
|
||||||
if reason and len(reason):
|
if reason and len(reason):
|
||||||
bm = i.mark(irc, uid, reason, msg.prefix,
|
bm = i.mark(irc, uid, reason, msg.prefix, self.getDb(irc.network), f, self)
|
||||||
self.getDb(irc.network), f, self)
|
|
||||||
else:
|
else:
|
||||||
bm = True
|
bm = True
|
||||||
b = b and be and bm
|
b = b and be and bm
|
||||||
@ -3986,11 +3985,11 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
flag = ircdb.makeChannelCapability(channel, 'flood')
|
flag = ircdb.makeChannelCapability(channel, 'flood')
|
||||||
isFlood = False
|
isFlood = False
|
||||||
if ircdb.checkCapability(msg.prefix, flag):
|
if ircdb.checkCapability(msg.prefix, flag):
|
||||||
isFlood = self._isFlood(irc, channel, best)
|
isFlood = self._isSomething(irc, channel, best, 'flood')
|
||||||
flag = ircdb.makeChannelCapability(channel, 'lowFlood')
|
flag = ircdb.makeChannelCapability(channel, 'lowFlood')
|
||||||
isLowFlood = False
|
isLowFlood = False
|
||||||
if ircdb.checkCapability(msg.prefix, flag):
|
if ircdb.checkCapability(msg.prefix, flag):
|
||||||
isLowFlood = self._isLowFlood(irc, channel, best)
|
isLowFlood = self._isSomething(irc, channel, best, 'lowFlood')
|
||||||
flag = ircdb.makeChannelCapability(channel, 'repeat')
|
flag = ircdb.makeChannelCapability(channel, 'repeat')
|
||||||
isRepeat = False
|
isRepeat = False
|
||||||
if ircdb.checkCapability(msg.prefix, flag):
|
if ircdb.checkCapability(msg.prefix, flag):
|
||||||
@ -4005,6 +4004,7 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
isCap = self._isCap(irc, channel, best, text)
|
isCap = self._isCap(irc, channel, best, text)
|
||||||
flag = ircdb.makeChannelCapability(channel, 'pattern')
|
flag = ircdb.makeChannelCapability(channel, 'pattern')
|
||||||
isPattern = False
|
isPattern = False
|
||||||
|
isTemporaryPattern = False
|
||||||
if ircdb.checkCapability(msg.prefix, flag):
|
if ircdb.checkCapability(msg.prefix, flag):
|
||||||
for p in chan.patterns:
|
for p in chan.patterns:
|
||||||
pattern = chan.patterns[p]
|
pattern = chan.patterns[p]
|
||||||
@ -4032,9 +4032,6 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
isBad = self._isBad(irc, channel, best)
|
isBad = self._isBad(irc, channel, best)
|
||||||
self.forceTickle = True
|
self.forceTickle = True
|
||||||
chan.countpattern(isPattern.uid, self.getDb(irc.network))
|
chan.countpattern(isPattern.uid, self.getDb(irc.network))
|
||||||
isTemporaryPattern = False
|
|
||||||
if isPattern:
|
|
||||||
pass
|
|
||||||
elif not isRepeat:
|
elif not isRepeat:
|
||||||
key = 'pattern%s' % channel
|
key = 'pattern%s' % channel
|
||||||
if key in chan.repeatLogs:
|
if key in chan.repeatLogs:
|
||||||
@ -4052,8 +4049,8 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
'repeatDuration', channel=channel, network=irc.network), 'temporary pattern', msg.nick)
|
'repeatDuration', channel=channel, network=irc.network), 'temporary pattern', msg.nick)
|
||||||
isBad = self._isBad(irc, channel, best)
|
isBad = self._isBad(irc, channel, best)
|
||||||
self.forceTickle = True
|
self.forceTickle = True
|
||||||
elif not isTemporaryPattern:
|
if not (isPattern or isTemporaryPattern) \
|
||||||
if isFlood or isHilight or isRepeat or isCap or isCtcp or isLowFlood:
|
and (isFlood or isLowFlood or isRepeat or isHilight or isCap or isCtcp):
|
||||||
isBad = self._isBad(irc, channel, best)
|
isBad = self._isBad(irc, channel, best)
|
||||||
kind = None
|
kind = None
|
||||||
duration = 0
|
duration = 0
|
||||||
@ -4744,15 +4741,9 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
+ self.registryValue('attackDuration', channel=channel, network=irc.network)))
|
+ self.registryValue('attackDuration', channel=channel, network=irc.network)))
|
||||||
return b
|
return b
|
||||||
|
|
||||||
def _isFlood(self, irc, channel, key):
|
|
||||||
return self._isSomething(irc, channel, key, 'flood')
|
|
||||||
|
|
||||||
def _isLowFlood(self, irc, channel, key):
|
|
||||||
return self._isSomething(irc, channel, key, 'lowFlood')
|
|
||||||
|
|
||||||
def _isHilight(self, irc, channel, key, message):
|
def _isHilight(self, irc, channel, key, message):
|
||||||
limit = self.registryValue('hilightPermit', channel=channel, network=irc.network)
|
limit = self.registryValue('hilightPermit', channel=channel, network=irc.network)
|
||||||
if limit == -1:
|
if limit < 0:
|
||||||
return False
|
return False
|
||||||
count = 0
|
count = 0
|
||||||
users = []
|
users = []
|
||||||
@ -4852,8 +4843,7 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def _isCap(self, irc, channel, key, message):
|
def _isCap(self, irc, channel, key, message):
|
||||||
limit = self.registryValue('capPermit', channel=channel, network=irc.network)
|
if self.registryValue('capPermit', channel=channel, network=irc.network) < 0:
|
||||||
if limit == -1:
|
|
||||||
return False
|
return False
|
||||||
trigger = self.registryValue('capPercent', channel=channel, network=irc.network)
|
trigger = self.registryValue('capPercent', channel=channel, network=irc.network)
|
||||||
match = self.recaps.findall(message)
|
match = self.recaps.findall(message)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user