mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-10-18 09:57:26 +02:00
Added a channel-specific enforce value.
This commit is contained in:
parent
180d2e8392
commit
0937ba22ca
@ -68,6 +68,10 @@ class ValidNickOrEmptyString(registry.String):
|
|||||||
self.value = v
|
self.value = v
|
||||||
|
|
||||||
conf.registerPlugin('Enforcer')
|
conf.registerPlugin('Enforcer')
|
||||||
|
conf.registerChannelValue(conf.supybot.plugins.Enforcer, 'enforce',
|
||||||
|
registry.Boolean(True, """Determines whether the bot will enforce
|
||||||
|
capabilities on this channel. Basically, if False, it 'turns off' the
|
||||||
|
plugin for this channel."""))
|
||||||
conf.registerChannelValue(conf.supybot.plugins.Enforcer, 'autoOp',
|
conf.registerChannelValue(conf.supybot.plugins.Enforcer, 'autoOp',
|
||||||
registry.Boolean(False, """Determines whether the bot will automatically op
|
registry.Boolean(False, """Determines whether the bot will automatically op
|
||||||
people with the <channel>,op capability when they join the channel."""))
|
people with the <channel>,op capability when they join the channel."""))
|
||||||
@ -274,13 +278,16 @@ class Enforcer(callbacks.Privmsg):
|
|||||||
self._cycle(irc, channel)
|
self._cycle(irc, channel)
|
||||||
|
|
||||||
def __call__(self, irc, msg):
|
def __call__(self, irc, msg):
|
||||||
chanserv = self.registryValue('ChanServ', irc.network)
|
channel = msg.args[0]
|
||||||
if chanserv:
|
if ircutils.isChannel(channel) and \
|
||||||
if ircutils.isUserHostmask(msg.prefix):
|
self.registryValue('enforce', channel):
|
||||||
if msg.nick != chanserv:
|
chanserv = self.registryValue('ChanServ', irc.network)
|
||||||
callbacks.Privmsg.__call__(self, irc, msg)
|
if chanserv:
|
||||||
else:
|
if ircutils.isUserHostmask(msg.prefix):
|
||||||
callbacks.Privmsg.__call__(self, irc, msg)
|
if msg.nick != chanserv:
|
||||||
|
callbacks.Privmsg.__call__(self, irc, msg)
|
||||||
|
else:
|
||||||
|
callbacks.Privmsg.__call__(self, irc, msg)
|
||||||
|
|
||||||
|
|
||||||
Class = Enforcer
|
Class = Enforcer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user