mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Anonymous: Use channel-specific variables. Closes GH-232.
This commit is contained in:
parent
570e30f1b7
commit
8add4911f5
@ -49,10 +49,10 @@ conf.registerChannelValue(conf.supybot.plugins.Anonymous,
|
|||||||
'requirePresenceInChannel', registry.Boolean(True, _("""Determines whether
|
'requirePresenceInChannel', registry.Boolean(True, _("""Determines whether
|
||||||
the bot should require people trying to use this plugin to be in the
|
the bot should require people trying to use this plugin to be in the
|
||||||
channel they wish to anonymously send to.""")))
|
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
|
registry.Boolean(True, _("""Determines whether the bot should require
|
||||||
people trying to use this plugin to be registered.""")))
|
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
|
registry.String('', _("""Determines what capability (if any) the bot should
|
||||||
require people trying to use this plugin to have.""")))
|
require people trying to use this plugin to have.""")))
|
||||||
conf.registerGlobalValue(conf.supybot.plugins.Anonymous, 'allowPrivateTarget',
|
conf.registerGlobalValue(conf.supybot.plugins.Anonymous, 'allowPrivateTarget',
|
||||||
|
@ -49,12 +49,12 @@ class Anonymous(callbacks.Plugin):
|
|||||||
supybot.plugins.Anonymous.requireRegistration.
|
supybot.plugins.Anonymous.requireRegistration.
|
||||||
"""
|
"""
|
||||||
def _preCheck(self, irc, msg, target, action):
|
def _preCheck(self, irc, msg, target, action):
|
||||||
if self.registryValue('requireRegistration'):
|
if self.registryValue('requireRegistration', target):
|
||||||
try:
|
try:
|
||||||
foo = ircdb.users.getUser(msg.prefix)
|
foo = ircdb.users.getUser(msg.prefix)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.errorNotRegistered(Raise=True)
|
irc.errorNotRegistered(Raise=True)
|
||||||
capability = self.registryValue('requireCapability')
|
capability = self.registryValue('requireCapability', target)
|
||||||
if capability:
|
if capability:
|
||||||
if not ircdb.checkCapability(msg.prefix, capability):
|
if not ircdb.checkCapability(msg.prefix, capability):
|
||||||
irc.errorNoCapability(capability, Raise=True)
|
irc.errorNoCapability(capability, Raise=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user