mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
Karma: fix allowSelfRating
This commit is contained in:
parent
42a858595b
commit
41fb0f8eca
@ -67,7 +67,7 @@ msgstr ""
|
||||
msgid "%(thing)s's karma is now %(karma)i"
|
||||
msgstr "%(thing)in karma on nyt %(karma)i"
|
||||
|
||||
#: plugin.py:251
|
||||
#: plugin.py:254 plugin.py:263
|
||||
msgid "You're not allowed to adjust your own karma."
|
||||
msgstr "Sinä et saa määrittää omaa karmaasi."
|
||||
|
||||
|
@ -62,7 +62,7 @@ msgstr ""
|
||||
msgid "%(thing)s's karma is now %(karma)i"
|
||||
msgstr "Le karma de %(thing)s est maintenant %(karma)i"
|
||||
|
||||
#: plugin.py:251
|
||||
#: plugin.py:254 plugin.py:263
|
||||
msgid "You're not allowed to adjust your own karma."
|
||||
msgstr "Vous n'êtes pas autorisé à modifier votre propre karma."
|
||||
|
||||
|
@ -55,7 +55,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Determina se il bot aumenterà o diminuirà il karma senza essere richiamato."
|
||||
|
||||
#: plugin.py:251
|
||||
#: plugin.py:254 plugin.py:263
|
||||
msgid "You're not allowed to adjust your own karma."
|
||||
msgstr "Non ti è permesso di modificare il tuo karma."
|
||||
|
||||
|
@ -246,18 +246,22 @@ class Karma(callbacks.Plugin):
|
||||
inc = self.registryValue('incrementChars', channel)
|
||||
dec = self.registryValue('decrementChars', channel)
|
||||
if thing.endswith(tuple(inc + dec)):
|
||||
if ircutils.strEqual(thing, msg.nick) and \
|
||||
not self.registryValue('allowSelfRating', channel):
|
||||
irc.error(_('You\'re not allowed to adjust your own karma.'),
|
||||
Raise=True)
|
||||
for s in inc:
|
||||
if thing.endswith(s):
|
||||
thing = thing[:-len(s)]
|
||||
if ircutils.strEqual(thing, msg.nick) and \
|
||||
not self.registryValue('allowSelfRating', channel):
|
||||
irc.error(_('You\'re not allowed to adjust your own karma.'))
|
||||
return
|
||||
self.db.increment(channel, self._normalizeThing(thing))
|
||||
karma = self.db.get(channel, self._normalizeThing(thing))
|
||||
for s in dec:
|
||||
if thing.endswith(s):
|
||||
thing = thing[:-len(s)]
|
||||
if ircutils.strEqual(thing, msg.nick) and \
|
||||
not self.registryValue('allowSelfRating', channel):
|
||||
irc.error(_('You\'re not allowed to adjust your own karma.'))
|
||||
return
|
||||
self.db.decrement(channel, self._normalizeThing(thing))
|
||||
karma = self.db.get(channel, self._normalizeThing(thing))
|
||||
self._respond(irc, channel, thing, karma[0]-karma[1])
|
||||
|
Loading…
Reference in New Issue
Block a user