From 51386068e4c7647ece3bbe7a969e75b431a9c584 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 9 Apr 2003 19:11:00 +0000 Subject: [PATCH] Finally got QUIT relaying to work. --- plugins/Relay.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/Relay.py b/plugins/Relay.py index 8745cb756..7dd8e46d2 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -98,17 +98,20 @@ class Relay(callbacks.Privmsg): callbacks.Privmsg.__init__(self) self.ircs = {} self.started = False - self.channels = set() self.ircstates = {} + self.lastmsg = ircmsgs.ping('this is just a fake message') + self.channels = set() self.abbreviations = {} def inFilter(self, irc, msg): if not isinstance(irc, irclib.Irc): irc = irc.getRealIrc() try: - self.ircstates[irc].enqueue(irc.state.copy()) + self.ircstates[irc].addMsg(irc, self.lastmsg) except KeyError: - self.ircstates[irc] = MaxLengthQueue(2, (irc.state.copy(),)) + self.ircstates[irc] = irclib.IrcState() + self.ircstates[irc].addMsg(irc, self.lastmsg) + self.lastmsg = msg return msg def startrelay(self, irc, msg, args): @@ -310,9 +313,8 @@ class Relay(callbacks.Privmsg): s = '%s/%s has quit.' % (msg.nick, network) for channel in self.channels: debug.printf(self.ircstates[irc]) - debug.printf(self.ircstates[irc][0]) - debug.printf(self.ircstates[irc][0].channels[channel].users) - if msg.nick in self.ircstates[irc][0].channels[channel].users: + debug.printf(self.ircstates[irc].channels[channel].users) + if msg.nick in self.ircstates[irc].channels[channel].users: for otherIrc in self.ircs.itervalues(): if otherIrc != irc: otherIrc.queueMsg(ircmsgs.privmsg(channel, s))