diff --git a/plugins/AutoMode/config.py b/plugins/AutoMode/config.py index 4c2e2dc40..aa163e1b9 100644 --- a/plugins/AutoMode/config.py +++ b/plugins/AutoMode/config.py @@ -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 diff --git a/plugins/AutoMode/plugin.py b/plugins/AutoMode/plugin.py index daff77dab..d6532cb34 100644 --- a/plugins/AutoMode/plugin.py +++ b/plugins/AutoMode/plugin.py @@ -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):