Unified the ircs' histories, making lastfrom work correctly.

This commit is contained in:
Jeremy Fincher 2003-08-26 16:40:31 +00:00
parent b1a392c691
commit 898b219871
1 changed files with 7 additions and 5 deletions

View File

@ -193,6 +193,7 @@ class Relay(callbacks.Privmsg):
else: else:
port = 6667 port = 6667
newIrc = irclib.Irc(irc.nick, callbacks=realIrc.callbacks) newIrc = irclib.Irc(irc.nick, callbacks=realIrc.callbacks)
newIrc.state.history = realIrc.state.history
driver = drivers.newDriver((server, port), newIrc) driver = drivers.newDriver((server, port), newIrc)
newIrc.driver = driver newIrc.driver = driver
self.ircs[abbreviation] = newIrc self.ircs[abbreviation] = newIrc
@ -358,11 +359,12 @@ class Relay(callbacks.Privmsg):
(replyIrc, replyMsg, d) = self.whois[(irc, nick)] (replyIrc, replyMsg, d) = self.whois[(irc, nick)]
hostmask = '@'.join(d['311'].args[2:4]) hostmask = '@'.join(d['311'].args[2:4])
user = d['311'].args[-1] user = d['311'].args[-1]
channels = d['319'].args[-1].split() if '319' in d:
if len(channels) == 1: channels = d['319'].args[-1].split()
channels = channels[0] channels[0] = 'is on ' + channels[0]
else: else:
channels = utils.commaAndify(channels) channels = ['isn\'t on any channels.']
channels = utils.commaAndify(channels)
if '317' in d: if '317' in d:
idle = utils.timeElapsed(d['317'].args[2]) idle = utils.timeElapsed(d['317'].args[2])
signon = time.strftime(conf.humanTimestampFormat, signon = time.strftime(conf.humanTimestampFormat,
@ -370,7 +372,7 @@ class Relay(callbacks.Privmsg):
else: else:
idle = '<unknown>' idle = '<unknown>'
signon = '<unknown>' signon = '<unknown>'
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) (user, hostmask, signon, idle, channels)
replyIrc.reply(replyMsg, s) replyIrc.reply(replyMsg, s)
del self.whois[(irc, nick)] del self.whois[(irc, nick)]