Removed several instances where it would raise exceptions the message after parting a channel.

This commit is contained in:
Jeremy Fincher 2003-10-15 05:56:32 +00:00
parent bd7f1f9389
commit f987a6e69b

View File

@ -52,7 +52,7 @@ import ircutils
class ChannelLogger(irclib.IrcCallback):
logs = ircutils.IrcDict()
def __init__(self):
self.laststate = irclib.IrcState()
self.laststate = None
self.lastMsg = None
world.flushers.append(self.flush)
@ -66,6 +66,8 @@ class ChannelLogger(irclib.IrcCallback):
super(self.__class__, self).__call__(irc, msg)
if self.lastMsg:
self.laststate.addMsg(irc, self.lastMsg)
else:
self.laststate = irc.state.copy()
finally:
# We must make sure this always gets updated.
self.lastMsg = msg
@ -172,8 +174,9 @@ class ChannelLogger(irclib.IrcCallback):
def outFilter(self, irc, msg):
# Gotta catch my own messages *somehow* :)
# Let's try this little trick...
m = ircmsgs.IrcMsg(msg=msg, prefix=irc.prefix)
self(irc, m)
if msg.command != 'PART':
m = ircmsgs.IrcMsg(msg=msg, prefix=irc.prefix)
self(irc, m)
return msg