callbacks.py: Always error when capabilities aren't satisfied.

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
James McCoy 2012-07-30 23:21:26 -04:00
parent a42ab2e2d4
commit d053a660b0

View File

@ -465,13 +465,15 @@ class RichReplyMethods(object):
if isinstance(capability, basestring): # checkCommandCapability! if isinstance(capability, basestring): # checkCommandCapability!
log.warning('Denying %s for lacking %q capability.', log.warning('Denying %s for lacking %q capability.',
self.msg.prefix, capability) self.msg.prefix, capability)
if not self._getConfig(conf.supybot.reply.error.noCapability): # noCapability means "don't send a specific capability error
v = self._getConfig(conf.supybot.replies.noCapability) # message" not "don't send a capability error message at all", like
s = self.__makeReply(v % capability, s) # one would think
return self._error(s, **kwargs) if self._getConfig(conf.supybot.reply.error.noCapability):
v = self._getConfig(conf.supybot.replies.genericNoCapability)
else: else:
log.debug('Not sending capability error, ' v = self._getConfig(conf.supybot.replies.noCapability)
'supybot.reply.error.noCapability is False.') s = self.__makeReply(v % capability, s)
return self._error(s, **kwargs)
else: else:
log.warning('Denying %s for some unspecified capability ' log.warning('Denying %s for some unspecified capability '
'(or a default).', self.msg.prefix) '(or a default).', self.msg.prefix)