Skip to content

Commit 8add491

Browse files
committed
Anonymous: Use channel-specific variables. Closes GH-232.
1 parent 570e30f commit 8add491

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/Anonymous/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ def configure(advanced):
4949
'requirePresenceInChannel', registry.Boolean(True, _("""Determines whether
5050
the bot should require people trying to use this plugin to be in the
5151
channel they wish to anonymously send to.""")))
52-
conf.registerGlobalValue(conf.supybot.plugins.Anonymous, 'requireRegistration',
52+
conf.registerChannelValue(conf.supybot.plugins.Anonymous, 'requireRegistration',
5353
registry.Boolean(True, _("""Determines whether the bot should require
5454
people trying to use this plugin to be registered.""")))
55-
conf.registerGlobalValue(conf.supybot.plugins.Anonymous, 'requireCapability',
55+
conf.registerChannelValue(conf.supybot.plugins.Anonymous, 'requireCapability',
5656
registry.String('', _("""Determines what capability (if any) the bot should
5757
require people trying to use this plugin to have.""")))
5858
conf.registerGlobalValue(conf.supybot.plugins.Anonymous, 'allowPrivateTarget',

plugins/Anonymous/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ class Anonymous(callbacks.Plugin):
4949
supybot.plugins.Anonymous.requireRegistration.
5050
"""
5151
def _preCheck(self, irc, msg, target, action):
52-
if self.registryValue('requireRegistration'):
52+
if self.registryValue('requireRegistration', target):
5353
try:
5454
foo = ircdb.users.getUser(msg.prefix)
5555
except KeyError:
5656
irc.errorNotRegistered(Raise=True)
57-
capability = self.registryValue('requireCapability')
57+
capability = self.registryValue('requireCapability', target)
5858
if capability:
5959
if not ircdb.checkCapability(msg.prefix, capability):
6060
irc.errorNoCapability(capability, Raise=True)

0 commit comments

Comments
 (0)