Alias: fix locking and unlocking for escaped aliases

This commit is contained in:
jacksonmj 2015-08-22 11:32:46 +00:00
parent a39238aba9
commit 711572b5b2

View File

@ -303,7 +303,12 @@ class Alias(callbacks.Plugin):
""" """
if name in self.aliases and self.isCommandMethod(name): if name in self.aliases and self.isCommandMethod(name):
self.aliases[name][1] = True self.aliases[name][1] = True
conf.supybot.plugins.Alias.aliases.get(name).locked.setValue(True) if (needsEscaping(name)):
group = conf.supybot.plugins.Alias.escapedaliases
name = escapeAlias(name)
else:
group = conf.supybot.plugins.Alias.aliases
group.get(name).locked.setValue(True)
irc.replySuccess() irc.replySuccess()
else: else:
irc.error(_('There is no such alias.')) irc.error(_('There is no such alias.'))
@ -317,7 +322,12 @@ class Alias(callbacks.Plugin):
""" """
if name in self.aliases and self.isCommandMethod(name): if name in self.aliases and self.isCommandMethod(name):
self.aliases[name][1] = False self.aliases[name][1] = False
conf.supybot.plugins.Alias.aliases.get(name).locked.setValue(False) if (needsEscaping(name)):
group = conf.supybot.plugins.Alias.escapedaliases
name = escapeAlias(name)
else:
group = conf.supybot.plugins.Alias.aliases
group.get(name).locked.setValue(False)
irc.replySuccess() irc.replySuccess()
else: else:
irc.error(_('There is no such alias.')) irc.error(_('There is no such alias.'))