plugins/Alias: Update Alias.lock and Alias.unlock to work now that aliases are no longer attributes of the plugin.

This commit is contained in:
James Vega 2006-04-27 22:11:30 +00:00
parent e15a5618b0
commit afc78317c7

View File

@ -219,7 +219,7 @@ class Alias(callbacks.Plugin):
Locks an alias so that no one else can change it. Locks an alias so that no one else can change it.
""" """
if hasattr(self, name) 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) conf.supybot.plugins.Alias.aliases.get(name).locked.setValue(True)
irc.replySuccess() irc.replySuccess()
@ -232,7 +232,7 @@ class Alias(callbacks.Plugin):
Unlocks an alias so that people can define new aliases over it. Unlocks an alias so that people can define new aliases over it.
""" """
if hasattr(self, name) 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) conf.supybot.plugins.Alias.aliases.get(name).locked.setValue(False)
irc.replySuccess() irc.replySuccess()