From 40310c4d5ad29b4ec6c88b018623f49a0c2c4f65 Mon Sep 17 00:00:00 2001 From: GLolol Date: Sun, 11 Jan 2015 19:47:20 -0800 Subject: [PATCH] Karma: only track karma for nicks --- plugins/Karma/plugin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/Karma/plugin.py b/plugins/Karma/plugin.py index 2b8671530..3ce2bc7f4 100644 --- a/plugins/Karma/plugin.py +++ b/plugins/Karma/plugin.py @@ -250,6 +250,10 @@ class Karma(callbacks.Plugin): for s in inc: if thing.endswith(s): thing = thing[:-len(s)] + # Don't reply if the target isn't a nick + if thing.lower() not in map(ircutils.toLower, + irc.state.channels[channel].users): + return if ircutils.strEqual(thing, msg.nick) and \ not self.registryValue('allowSelfRating', channel): irc.error(_('You\'re not allowed to adjust your own karma.')) @@ -259,6 +263,9 @@ class Karma(callbacks.Plugin): for s in dec: if thing.endswith(s): thing = thing[:-len(s)] + if thing.lower() not in map(ircutils.toLower, + irc.state.channels[channel].users): + return if ircutils.strEqual(thing, msg.nick) and \ not self.registryValue('allowSelfRating', channel): irc.error(_('You\'re not allowed to adjust your own karma.'))