mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Fixed bug in handling of outFilters returning None
This commit is contained in:
parent
954951e2d2
commit
41aa44ee78
@ -278,11 +278,10 @@ class Irc(object):
|
|||||||
for (i, cb) in enumerate(self.callbacks):
|
for (i, cb) in enumerate(self.callbacks):
|
||||||
if cb.name() == name:
|
if cb.name() == name:
|
||||||
toRemove.append(i)
|
toRemove.append(i)
|
||||||
if toRemove:
|
for i in reviter(range(len(self.callbacks))):
|
||||||
for i in reviter(range(len(self.callbacks))):
|
if toRemove and toRemove[-1] == i:
|
||||||
if toRemove and toRemove[-1] == i:
|
toRemove.pop()
|
||||||
toRemove.pop()
|
ret.append(self.callbacks.pop(i))
|
||||||
ret.append(self.callbacks.pop(i))
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def queueMsg(self, msg):
|
def queueMsg(self, msg):
|
||||||
@ -312,6 +311,10 @@ class Irc(object):
|
|||||||
for callback in self.callbacks:
|
for callback in self.callbacks:
|
||||||
#debug.printf(repr(msg))
|
#debug.printf(repr(msg))
|
||||||
msg = callback.outFilter(self, msg)
|
msg = callback.outFilter(self, msg)
|
||||||
|
if msg is None:
|
||||||
|
s = 'outFilter %s returned None' % callbacks.name()
|
||||||
|
debug.debugMsg(s)
|
||||||
|
return None
|
||||||
self.state.addMsg(self,ircmsgs.IrcMsg(msg=msg, prefix=self.prefix))
|
self.state.addMsg(self,ircmsgs.IrcMsg(msg=msg, prefix=self.prefix))
|
||||||
s = '%s %s' % (time.strftime(conf.timestampFormat), msg)
|
s = '%s %s' % (time.strftime(conf.timestampFormat), msg)
|
||||||
debug.debugMsg(s, 'low')
|
debug.debugMsg(s, 'low')
|
||||||
|
Loading…
Reference in New Issue
Block a user