mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-03-29 10:56:57 +01:00
Removed several instances where it would raise exceptions the message after parting a channel.
This commit is contained in:
parent
bd7f1f9389
commit
f987a6e69b
@ -52,7 +52,7 @@ import ircutils
|
|||||||
class ChannelLogger(irclib.IrcCallback):
|
class ChannelLogger(irclib.IrcCallback):
|
||||||
logs = ircutils.IrcDict()
|
logs = ircutils.IrcDict()
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.laststate = irclib.IrcState()
|
self.laststate = None
|
||||||
self.lastMsg = None
|
self.lastMsg = None
|
||||||
world.flushers.append(self.flush)
|
world.flushers.append(self.flush)
|
||||||
|
|
||||||
@ -66,6 +66,8 @@ class ChannelLogger(irclib.IrcCallback):
|
|||||||
super(self.__class__, self).__call__(irc, msg)
|
super(self.__class__, self).__call__(irc, msg)
|
||||||
if self.lastMsg:
|
if self.lastMsg:
|
||||||
self.laststate.addMsg(irc, self.lastMsg)
|
self.laststate.addMsg(irc, self.lastMsg)
|
||||||
|
else:
|
||||||
|
self.laststate = irc.state.copy()
|
||||||
finally:
|
finally:
|
||||||
# We must make sure this always gets updated.
|
# We must make sure this always gets updated.
|
||||||
self.lastMsg = msg
|
self.lastMsg = msg
|
||||||
@ -172,8 +174,9 @@ class ChannelLogger(irclib.IrcCallback):
|
|||||||
def outFilter(self, irc, msg):
|
def outFilter(self, irc, msg):
|
||||||
# Gotta catch my own messages *somehow* :)
|
# Gotta catch my own messages *somehow* :)
|
||||||
# Let's try this little trick...
|
# Let's try this little trick...
|
||||||
m = ircmsgs.IrcMsg(msg=msg, prefix=irc.prefix)
|
if msg.command != 'PART':
|
||||||
self(irc, m)
|
m = ircmsgs.IrcMsg(msg=msg, prefix=irc.prefix)
|
||||||
|
self(irc, m)
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user