cleaned a bit some config option names:

dontRequestComment => commentRequest.ignore
forwardRequest     => commentRequest.forward
forwardChannels    => commentRequest.forward.channels
This commit is contained in:
Elián Hanisch 2010-03-15 23:26:19 -03:00
parent 144291b933
commit 287038b1e3
2 changed files with 11 additions and 12 deletions

View File

@ -26,19 +26,18 @@ conf.registerGlobalValue(conf.supybot.plugins.Bantracker, 'database',
conf.registerGlobalValue(conf.supybot.plugins.Bantracker, 'bansite',
registry.String('', "Web site for the bantracker, without the 'bans.cgi' appended", private=True))
conf.registerChannelValue(Bantracker, 'dontRequestComment',
conf.registerGroup(Bantracker, 'commentRequest')
conf.registerChannelValue(Bantracker.commentRequest, 'ignore',
registry.SpaceSeparatedListOfStrings([],
"List of nicks for which the bot won't request to comment a ban/quiet/removal."\
" Is case insensible and wildcards * ? are accepted."))
conf.registerChannelValue(Bantracker, 'forwardRequest',
conf.registerChannelValue(Bantracker.commentRequest, 'forward',
registry.SpaceSeparatedListOfStrings([],
"List of nicks for which the bot will forward the comment request to"\
" the channels/nicks defined in forwardChannel option."\
"List of nicks for which the bot will forward the request to"\
" the channels/nicks defined in forwards.channels option."\
" Is case insensible and wildcards * ? are accepted."))
conf.registerChannelValue(Bantracker, 'forwardChannels',
conf.registerChannelValue(Bantracker.commentRequest.forward, 'channels',
registry.SpaceSeparatedListOfStrings([],
"List of channels/nicks to forward comment request if the op that set the ban/quiet"\
" is in the forwardRequest list."))
"List of channels/nicks to forward the request if the op that set the ban/quiet"\
" is in the forward list."))

View File

@ -339,7 +339,7 @@ class Bantracker(callbacks.Plugin):
def requestComment(self, irc, channel, ban, type=None):
# check if we should request a comment
if nickMatch(ban.who, self.registryValue('dontRequestComment', channel=channel)):
if nickMatch(ban.who, self.registryValue('commentRequest.ignore', channel=channel)):
return
# check the type of the action taken
mask = ban.mask
@ -354,8 +354,8 @@ class Bantracker(callbacks.Plugin):
# send msg
prefix = conf.supybot.reply.whenAddressedBy.chars()[0]
# check to who send the request
if nickMatch(ban.who, self.registryValue('forwardRequest', channel=channel)):
channels = self.registryValue('forwardChannels', channel=channel)
if nickMatch(ban.who, self.registryValue('commentRequest.forward', channel=channel)):
channels = self.registryValue('commentRequest.forward.channels', channel=channel)
if channels:
s = "Please comment on the %s of %s in %s done by %s, use: %scomment %s <comment>" \
%(type, mask, channel, ban.who, prefix, ban.id)