Commit d9fde941 authored by Svetlana Tkachenko's avatar Svetlana Tkachenko
Browse files

Make karma more aggressive toward users who increment their own karma

parent 548b974f
......@@ -71,6 +71,11 @@ class Karma(object):
self.userpoints[nick] = 0
self.server.doMessage(channel, user + ": " + args[0] + " has " + str(self.userpoints[nick]) + " points.")
def karma_change(self, lnick, n):
if self.userpoints.get(lnick, None) is None:
self.userpoints[lnick] = n
else:
self.userpoints[lnick] += n
def handle_message(self, channel, user, message):
if self.karma_re.match(message):
......@@ -80,16 +85,11 @@ class Karma(object):
for nick in addlist:
lnick = nick.lower()
if self.userpoints.get(lnick, None) is None:
self.userpoints[lnick] = 1
if (user.lower() == lnick):
self.karma_change(lnick, -1)
else:
total = self.userpoints[lnick] + 1
self.userpoints[lnick] = total
self.karma_change(lnick, +1)
for nick in sublist:
lnick = nick.lower()
if self.userpoints.get(lnick, None) is None:
self.userpoints[lnick] = -1
else:
total = self.userpoints[lnick] - 1
self.userpoints[lnick] = total
self.karma_change(lnick, -1)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment