mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-10 12:59:22 +01:00
Fix for bug in Irc.removeCallback.
This commit is contained in:
parent
e1dfcbd390
commit
2227f5caae
@ -327,9 +327,9 @@ class Irc(object):
|
|||||||
self.callbacks.append(callback)
|
self.callbacks.append(callback)
|
||||||
|
|
||||||
def removeCallback(self, name):
|
def removeCallback(self, name):
|
||||||
ret = filter(name.__eq__, self.callbacks)
|
(bad, good) = partition(lambda cb: cb.name() == name, self.callbacks)
|
||||||
self.callbacks[:] = [cb for cb in self.callbacks if name != cb.name()]
|
self.callbacks[:] = good
|
||||||
return ret
|
return bad
|
||||||
|
|
||||||
def queueMsg(self, msg):
|
def queueMsg(self, msg):
|
||||||
self.queue.enqueue(msg)
|
self.queue.enqueue(msg)
|
||||||
@ -348,7 +348,7 @@ class Irc(object):
|
|||||||
else:
|
else:
|
||||||
self.lastTake = now
|
self.lastTake = now
|
||||||
msg = self.queue.dequeue()
|
msg = self.queue.dequeue()
|
||||||
elif len(self.outstandingPongs) > 2:
|
elif len(self.outstandingPongs) >= 2:
|
||||||
# Our pings hasn't be responded to.
|
# Our pings hasn't be responded to.
|
||||||
debug.msg('Reconnecting, 3 pings not replied to.', 'normal')
|
debug.msg('Reconnecting, 3 pings not replied to.', 'normal')
|
||||||
if hasattr(self.driver, 'scheduleReconnect'):
|
if hasattr(self.driver, 'scheduleReconnect'):
|
||||||
|
Loading…
Reference in New Issue
Block a user