Skip to content

Commit

Permalink
Anonymous: Use channel-specific variables. Closes GH-232.
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Feb 11, 2012
1 parent 570e30f commit 8add491
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/Anonymous/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ def configure(advanced):
'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',
Expand Down
4 changes: 2 additions & 2 deletions plugins/Anonymous/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8add491

Please sign in to comment.