Fixed bug in doKick.

This commit is contained in:
Jeremy Fincher 2003-09-03 18:45:17 +00:00
parent dfb1b26333
commit fa878a9289

View File

@ -115,11 +115,18 @@ class ChannelLogger(irclib.IrcCallback):
(msg.nick or msg.prefix, channel)) (msg.nick or msg.prefix, channel))
def doKick(self, irc, msg): def doKick(self, irc, msg):
if len(msg.args) == 3:
(channel, target, kickmsg) = msg.args (channel, target, kickmsg) = msg.args
else:
(channel, target) = msg.args
kickmsg = ''
log = self.getLog(channel) log = self.getLog(channel)
self.timestamp(log) self.timestamp(log)
if kickmsg:
log.write('*** %s was kicked by %s (%s)\n' % \ log.write('*** %s was kicked by %s (%s)\n' % \
(target, msg.nick, kickmsg)) (target, msg.nick, kickmsg))
else:
log.write('*** %s was kicked by %s\n' % (target, msg.nick)
def doPart(self, irc, msg): def doPart(self, irc, msg):
for channel in msg.args[0].split(','): for channel in msg.args[0].split(','):