|
# File contrib/plugins/stats.rb, line 87
def listener(m)
if not m.private?
tokens = @channels[m.target]
if not @@commands[m.plugin]
tokens.each_pair { |key, hsh|
if not m.message.scan(/\b#{Regexp.escape(key)}\b/).empty?
if hsh[m.sourcenick]
hsh[m.sourcenick] += 1
else
hsh[m.sourcenick] = 1
end
end
}
end
end
#This is the old code {{{
# if not m.private?
# tokens = @channels[m.target]
# hsh = tokens[m.message]
# if hsh
# if hsh[m.sourcenick]
# hsh[m.sourcenick] += 1
# else
# hsh[m.sourcenick] = 1
# end
# end
# end }}}
end
|