mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 14:59:34 +01:00
Forgot to actually creat the _snarfedUrls attribute.
This commit is contained in:
parent
867814eb1d
commit
4200349aea
@ -155,13 +155,16 @@ def urlSnarfer(f):
|
|||||||
def newf(self, irc, msg, match, *L):
|
def newf(self, irc, msg, match, *L):
|
||||||
now = time.time()
|
now = time.time()
|
||||||
cutoff = now - conf.snarfThrottle
|
cutoff = now - conf.snarfThrottle
|
||||||
while self._snarfedUrls and self._snarfedUrls[0][2] < cutoff:
|
q = getattr(self, '_snarfedUrls', None)
|
||||||
self._snarfedUrls.dequeue()
|
if q is None:
|
||||||
|
q = structures.fastqueue()
|
||||||
|
while q and q[0][2] < cutoff:
|
||||||
|
q.dequeue()
|
||||||
url = match.group(0)
|
url = match.group(0)
|
||||||
if any(lambda t: t[0]==url and t[1]==msg.args[0], self._snarfedUrls):
|
if any(lambda t: t[0] == url and t[1] == msg.args[0], q):
|
||||||
debug.msg('Refusing to snarf %s.')
|
debug.msg('Refusing to snarf %s.')
|
||||||
else:
|
else:
|
||||||
self._snarfedUrls.enqueue((url, msg.args[0], now))
|
q.enqueue((url, msg.args[0], now))
|
||||||
f(self, irc, msg, match, *L)
|
f(self, irc, msg, match, *L)
|
||||||
newf = types.FunctionType(newf.func_code, newf.func_globals,
|
newf = types.FunctionType(newf.func_code, newf.func_globals,
|
||||||
f.func_name, closure=newf.func_closure)
|
f.func_name, closure=newf.func_closure)
|
||||||
|
Loading…
Reference in New Issue
Block a user