From bb9c956eea8fe3140561209414e2a6c706a01e30 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 23 Sep 2003 19:39:48 +0000 Subject: [PATCH] Made sure there were no problems in __call__ if it wasn't started. --- plugins/Relay.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/Relay.py b/plugins/Relay.py index 83ebdfc7b..6644b6bba 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -133,13 +133,14 @@ class Relay(callbacks.Privmsg): self.originalIrc = None def __call__(self, irc, msg): - if not isinstance(irc, irclib.Irc): - irc = irc.getRealIrc() - try: - self.ircstates[irc].addMsg(irc, self.lastmsg[irc]) - callbacks.Privmsg.__call__(self, irc, msg) - finally: - self.lastmsg[irc] = msg + if self.started: + try: + if not isinstance(irc, irclib.Irc): + irc = irc.getRealIrc() + self.ircstates[irc].addMsg(irc, self.lastmsg[irc]) + finally: + self.lastmsg[irc] = msg + callbacks.Privmsg.__call__(self, irc, msg) def die(self): for irc in self.abbreviations: