mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +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,14 +57,19 @@ 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
|
||||
if self.registryValue('alternativeCapabilities', channel):
|
||||
try:
|
||||
override = ircdb.checkCapability(msg.prefix, cap_auto,
|
||||
ignoreOwner=not self.registryValue('owner'))
|
||||
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):
|
||||
self.log.info('Scheduling auto-%s of %s in %s.',
|
||||
|
Loading…
Reference in New Issue
Block a user