AutoMode: Disable overriding rights of auto* capabilities.

This commit is contained in:
Valentin Lorentz 2013-12-22 17:10:02 +00:00
parent 19066b62a3
commit 4a20270655

View File

@ -55,18 +55,19 @@ class AutoMode(callbacks.Plugin):
def do(type):
cap = ircdb.makeChannelCapability(channel, type)
cap_auto = ircdb.makeChannelCapability(channel, 'auto'+type)
try:
apply_mode = ircdb.checkCapability(msg.prefix, cap,
ignoreOwner=not self.registryValue('owner'))
except KeyError:
apply_mode = False
try:
override = ircdb.checkCapability(msg.prefix, cap_auto,
apply_mode |= ircdb.checkCapability(msg.prefix, cap,
ignoreOwner=not self.registryValue('owner'))
except KeyError:
override = False
if apply_mode or override:
if override or self.registryValue(type, channel):
pass
try:
apply_mode |= ircdb.checkCapability(msg.prefix, cap_auto,
ignoreOwner=not self.registryValue('owner'))
except KeyError:
pass
if apply_mode:
if self.registryValue(type, channel):
self.log.info('Scheduling auto-%s of %s in %s.',
type, msg.prefix, channel)
def dismiss():