mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
AutoMode: Fix alternative capabilities handling.
This commit is contained in:
parent
233571e4b5
commit
df375e075a
@ -48,6 +48,10 @@ conf.registerChannelValue(AutoMode, 'enable',
|
||||
conf.registerGlobalValue(AutoMode, 'owner',
|
||||
registry.Boolean(True, _("""Determines whether this plugin will automode
|
||||
owners even if they don't have op/halfop/voice/whatever capability.""")))
|
||||
conf.registerChannelValue(AutoMode, 'alternativeCapabilities',
|
||||
registry.Boolean(False, _("""Determines whether the bot will
|
||||
check for 'alternative capabilities' (ie. autoop, autohalfop,
|
||||
autovoice) in addition to/instead of classic ones.""")))
|
||||
conf.registerChannelValue(AutoMode, 'fallthrough',
|
||||
registry.Boolean(False, _("""Determines whether the bot will "fall
|
||||
through" to halfop/voicing when auto-opping is turned off but
|
||||
|
@ -57,13 +57,18 @@ class AutoMode(callbacks.Plugin):
|
||||
cap_auto = ircdb.makeChannelCapability(channel, 'auto'+type)
|
||||
try:
|
||||
apply_mode = ircdb.checkCapability(msg.prefix, cap,
|
||||
ignoreOwner=not self.registryValue('owner'))
|
||||
ignoreOwner=not self.registryValue('owner'),
|
||||
ignoreChannelOp=True, ignoreDefaultAllow=True)
|
||||
except KeyError:
|
||||
apply_mode = False
|
||||
try:
|
||||
override = ircdb.checkCapability(msg.prefix, cap_auto,
|
||||
ignoreOwner=not self.registryValue('owner'))
|
||||
except KeyError:
|
||||
if self.registryValue('alternativeCapabilities', channel):
|
||||
try:
|
||||
override = ircdb.checkCapability(msg.prefix, cap_auto,
|
||||
ignoreOwner=not self.registryValue('owner'),
|
||||
ignoreChannelOp=True, ignoreDefaultAllow=True)
|
||||
except KeyError:
|
||||
override = False
|
||||
else:
|
||||
override = False
|
||||
if apply_mode or override:
|
||||
if override or self.registryValue(type, channel):
|
||||
|
Loading…
Reference in New Issue
Block a user