From 898b21987173a0e0b77a103826b6ef62665ff6f4 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 26 Aug 2003 16:40:31 +0000 Subject: [PATCH] Unified the ircs' histories, making lastfrom work correctly. --- plugins/Relay.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/Relay.py b/plugins/Relay.py index 73a2b3e24..7a9b4cbd8 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -193,6 +193,7 @@ class Relay(callbacks.Privmsg): else: port = 6667 newIrc = irclib.Irc(irc.nick, callbacks=realIrc.callbacks) + newIrc.state.history = realIrc.state.history driver = drivers.newDriver((server, port), newIrc) newIrc.driver = driver self.ircs[abbreviation] = newIrc @@ -358,11 +359,12 @@ class Relay(callbacks.Privmsg): (replyIrc, replyMsg, d) = self.whois[(irc, nick)] hostmask = '@'.join(d['311'].args[2:4]) user = d['311'].args[-1] - channels = d['319'].args[-1].split() - if len(channels) == 1: - channels = channels[0] + if '319' in d: + channels = d['319'].args[-1].split() + channels[0] = 'is on ' + channels[0] else: - channels = utils.commaAndify(channels) + channels = ['isn\'t on any channels.'] + channels = utils.commaAndify(channels) if '317' in d: idle = utils.timeElapsed(d['317'].args[2]) signon = time.strftime(conf.humanTimestampFormat, @@ -370,7 +372,7 @@ class Relay(callbacks.Privmsg): else: idle = '' signon = '' - s = '%s (%s) has been online since %s (idle for %s) and is on %s' % \ + s = '%s (%s) has been online since %s (idle for %s) and %s' % \ (user, hostmask, signon, idle, channels) replyIrc.reply(replyMsg, s) del self.whois[(irc, nick)]