mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Fixed bug in Irc.reset.
This commit is contained in:
parent
1131cc4f15
commit
d9b994f6fe
@ -354,7 +354,7 @@ class Irc(object):
|
|||||||
self.state.reset()
|
self.state.reset()
|
||||||
self.queue.reset()
|
self.queue.reset()
|
||||||
self.lastping = time.time()
|
self.lastping = time.time()
|
||||||
self.outstandingPongs = False
|
self.outstandingPing = False
|
||||||
self.fastqueue = queue()
|
self.fastqueue = queue()
|
||||||
if self.password:
|
if self.password:
|
||||||
self.queue.enqueue(ircmsgs.password(self.password))
|
self.queue.enqueue(ircmsgs.password(self.password))
|
||||||
@ -366,6 +366,13 @@ class Irc(object):
|
|||||||
def addCallback(self, callback):
|
def addCallback(self, callback):
|
||||||
self.callbacks.append(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):
|
def removeCallback(self, name):
|
||||||
(bad, good) = partition(lambda cb: cb.name() == name, self.callbacks)
|
(bad, good) = partition(lambda cb: cb.name() == name, self.callbacks)
|
||||||
self.callbacks[:] = good
|
self.callbacks[:] = good
|
||||||
|
Loading…
Reference in New Issue
Block a user