From 8add4911f5f6cda1aedd9bc0a5dea9c698bb26d1 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 11 Feb 2012 13:41:29 +0100 Subject: [PATCH] Anonymous: Use channel-specific variables. Closes GH-232. --- plugins/Anonymous/config.py | 4 ++-- plugins/Anonymous/plugin.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Anonymous/config.py b/plugins/Anonymous/config.py index 51e6ba70b..de7aa590c 100644 --- a/plugins/Anonymous/config.py +++ b/plugins/Anonymous/config.py @@ -49,10 +49,10 @@ conf.registerChannelValue(conf.supybot.plugins.Anonymous, 'requirePresenceInChannel', registry.Boolean(True, _("""Determines whether the bot should require people trying to use this plugin to be in the channel they wish to anonymously send to."""))) -conf.registerGlobalValue(conf.supybot.plugins.Anonymous, 'requireRegistration', +conf.registerChannelValue(conf.supybot.plugins.Anonymous, 'requireRegistration', registry.Boolean(True, _("""Determines whether the bot should require people trying to use this plugin to be registered."""))) -conf.registerGlobalValue(conf.supybot.plugins.Anonymous, 'requireCapability', +conf.registerChannelValue(conf.supybot.plugins.Anonymous, 'requireCapability', registry.String('', _("""Determines what capability (if any) the bot should require people trying to use this plugin to have."""))) conf.registerGlobalValue(conf.supybot.plugins.Anonymous, 'allowPrivateTarget', diff --git a/plugins/Anonymous/plugin.py b/plugins/Anonymous/plugin.py index da845c9c1..960132d13 100644 --- a/plugins/Anonymous/plugin.py +++ b/plugins/Anonymous/plugin.py @@ -49,12 +49,12 @@ class Anonymous(callbacks.Plugin): supybot.plugins.Anonymous.requireRegistration. """ def _preCheck(self, irc, msg, target, action): - if self.registryValue('requireRegistration'): + if self.registryValue('requireRegistration', target): try: foo = ircdb.users.getUser(msg.prefix) except KeyError: irc.errorNotRegistered(Raise=True) - capability = self.registryValue('requireCapability') + capability = self.registryValue('requireCapability', target) if capability: if not ircdb.checkCapability(msg.prefix, capability): irc.errorNoCapability(capability, Raise=True)