slightly more anal silly karma handling

This commit is contained in:
Mike Bloy 2010-11-23 21:45:47 -06:00
parent f4dc667c77
commit 120dcc9fda
1 changed files with 4 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class Karma(Module):
Module.__init__(self, config, server, modlist)
pattern = "(?:(\S+)|\((.+)\))"
karmapattern = pattern + '(\+\+|--|\+-)' + '(\s+|$)'
karmapattern = pattern + '(\+\+|--|\+-|-\+)' + '(\s+|$)'
querypattern = '^rank\s+(.*)'
self.karmare = re.compile(karmapattern)
@ -94,6 +94,9 @@ class Karma(Module):
elif (value == '+-'):
self.karma_modify(key, 1, nick, userhost)
return self.karma_modify(key, -1, nick, userhost)
elif (value == '-+'):
self.karma_modify(key, -1, nick, userhost)
return self.karma_modify(key, 1, nick, userhost)
def karma_modify(self, key, value, nick, userhost):
"""