Update ChannelStats to obey channelSpecific.

This commit is contained in:
James Vega 2005-03-03 04:45:47 +00:00
parent 54d17d98b1
commit b7736d83e1

View File

@ -68,6 +68,7 @@ class ChannelStat(irclib.IrcCommandDispatcher):
method(msg) method(msg)
def doPayload(self, channel, payload): def doPayload(self, channel, payload):
channel = plugins.getChannel(channel)
self.chars += len(payload) self.chars += len(payload)
self.words += len(payload.split()) self.words += len(payload.split())
fRe = conf.supybot.plugins.ChannelStats.get('frowns').get(channel)() fRe = conf.supybot.plugins.ChannelStats.get('frowns').get(channel)()
@ -128,8 +129,8 @@ class StatsDB(plugins.ChannelUserDB):
return UserStat(*L) return UserStat(*L)
def addMsg(self, msg, id=None): def addMsg(self, msg, id=None):
channel = msg.args[0] if ircutils.isChannel(msg.args[0]):
if ircutils.isChannel(channel): channel = plugins.getChannel(msg.args[0])
if (channel, 'channelStats') not in self: if (channel, 'channelStats') not in self:
self[channel, 'channelStats'] = ChannelStat() self[channel, 'channelStats'] = ChannelStat()
self[channel, 'channelStats'].addMsg(msg) self[channel, 'channelStats'].addMsg(msg)