Aka: Fix encoding issue with Python 2.

This commit is contained in:
Valentin Lorentz 2013-08-25 15:40:56 +02:00
parent d26a1a5be9
commit d78ae3de7b

View File

@ -240,14 +240,14 @@ class Aka(callbacks.Plugin):
self._db = AkaDB()
def isCommandMethod(self, name):
if sys.version_info[0] < 3 and isinstance(name, str):
name = name.decode('utf8')
args = name.split(' ')
if len(args) > 1 and \
callbacks.canonicalName(args[0]) != self.canonicalName():
for cb in dynamic.irc.callbacks: # including this plugin
if cb.getCommand(args[0:-1]):
return False
if sys.version_info[0] < 3 and isinstance(name, str):
name = name.decode('utf8')
channel = dynamic.channel or 'global'
return self._db.has_aka(channel, name) or \
self._db.has_aka('global', name) or \