Fixed bug in Irc.reset.

This commit is contained in:
Jeremy Fincher 2003-06-06 04:47:18 +00:00
parent 1131cc4f15
commit d9b994f6fe

View File

@ -354,7 +354,7 @@ class Irc(object):
self.state.reset()
self.queue.reset()
self.lastping = time.time()
self.outstandingPongs = False
self.outstandingPing = False
self.fastqueue = queue()
if self.password:
self.queue.enqueue(ircmsgs.password(self.password))
@ -366,6 +366,13 @@ class Irc(object):
def addCallback(self, callback):
self.callbacks.append(callback)
def getCallback(self, name):
for callback in self.callbacks:
if callback.name() == name:
return callback
else:
return None
def removeCallback(self, name):
(bad, good) = partition(lambda cb: cb.name() == name, self.callbacks)
self.callbacks[:] = good