handle silly +- syntax, which will do both an increment and a decrement
(this won't impact the overall rank, of course, but does create log entries that may be interesting for later analysis
This commit is contained in:
parent
50e45b2a0d
commit
daa018c64b
@ -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)
|
||||
@ -89,7 +89,10 @@ class Karma(Module):
|
||||
value = match.group(3)
|
||||
if (value == '++'):
|
||||
return self.karma_modify(key, 1, nick, userhost)
|
||||
else:
|
||||
elif (value == '--'):
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user