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!
log.warning('Denying %s for lacking %q capability.',
self.msg.prefix, capability)
if not self._getConfig(conf.supybot.reply.error.noCapability):
v = self._getConfig(conf.supybot.replies.noCapability)
s = self.__makeReply(v % capability, s)
return self._error(s, **kwargs)
# noCapability means "don't send a specific capability error
# message" not "don't send a capability error message at all", like
# one would think
if self._getConfig(conf.supybot.reply.error.noCapability):
v = self._getConfig(conf.supybot.replies.genericNoCapability)
else:
log.debug('Not sending capability error, '
'supybot.reply.error.noCapability is False.')
v = self._getConfig(conf.supybot.replies.noCapability)
s = self.__makeReply(v % capability, s)
return self._error(s, **kwargs)
else:
log.warning('Denying %s for some unspecified capability '
'(or a default).', self.msg.prefix)