mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Fix for bug #846065.
This commit is contained in:
parent
0e8891871f
commit
37c6516693
@ -529,9 +529,9 @@ class Privmsg(irclib.IrcCallback):
|
||||
"""Base class for all Privmsg handlers."""
|
||||
threaded = False
|
||||
public = True
|
||||
handled = False
|
||||
alwaysCall = ()
|
||||
noIgnore = False
|
||||
handled = False
|
||||
commandArgs = ['self', 'irc', 'msg', 'args']
|
||||
_mores = {} # This must be class-scope, so all subclasses use the same one.
|
||||
def __init__(self):
|
||||
@ -617,7 +617,6 @@ class Privmsg(irclib.IrcCallback):
|
||||
def callCommand(self, f, irc, msg, *L):
|
||||
# Exceptions aren't caught here because IrcObjectProxy.finalEval
|
||||
# catches them and does The Right Thing.
|
||||
Privmsg.handled = True
|
||||
start = time.time()
|
||||
f(irc, msg, *L)
|
||||
elapsed = time.time() - start
|
||||
@ -739,24 +738,26 @@ class PrivmsgCommandAndRegexp(Privmsg):
|
||||
raise
|
||||
|
||||
def doPrivmsg(self, irc, msg):
|
||||
handled = False
|
||||
for (r, method) in self.res:
|
||||
originalHandled = self.handled
|
||||
name = method.__name__
|
||||
if handled and name not in self.alwaysCall:
|
||||
continue
|
||||
for m in r.finditer(msg.args[1]):
|
||||
if originalHandled and name not in self.alwaysCall:
|
||||
continue
|
||||
proxy = IrcObjectProxyRegexp(irc)
|
||||
self.callCommand(method, proxy, msg, m, catchErrors=True)
|
||||
s = addressed(irc.nick, msg)
|
||||
if s:
|
||||
for (r, method) in self.addressedRes:
|
||||
originalHandled = self.handled
|
||||
name = method.__name__
|
||||
for m in r.finditer(s):
|
||||
if originalHandled and name not in self.alwaysCall:
|
||||
handled = True
|
||||
if not Privmsg.handled:
|
||||
s = addressed(irc.nick, msg)
|
||||
if s:
|
||||
for (r, method) in self.addressedRes:
|
||||
name = method.__name__
|
||||
if handled and name not in self.alwaysCall:
|
||||
continue
|
||||
proxy = IrcObjectProxyRegexp(irc)
|
||||
self.callCommand(method,proxy,msg,m,catchErrors=True)
|
||||
for m in r.finditer(s):
|
||||
proxy = IrcObjectProxyRegexp(irc)
|
||||
self.callCommand(method,proxy,msg,m,catchErrors=True)
|
||||
handled = True
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
Loading…
Reference in New Issue
Block a user