Rbls: Add supybot.plugins.Rbls.enable.

master
Valentin Lorentz 2013-05-20 19:19:01 +02:00
parent f7b83e05f7
commit 823f49770c
3 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,9 @@ Rbls = conf.registerPlugin('Rbls')
# This is where your configuration variables (if any) should go. For example:
# conf.registerGlobalValue(Rbls, 'someConfigVariableName',
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(Rbls, 'enable',
registry.Boolean(False, _("""Determines whether or not this plugin will
kickban users blacklisted with Rbls.""")))
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:

View File

@ -49,6 +49,8 @@ class Rbls(callbacks.Plugin):
def doJoin(self, irc, msg):
channel = msg.args[0]
if not self.registryValue('enable', channel):
return
nick, ident, host = ircutils.splitHostmask(msg.prefix)
fd = utils.web.getUrlFd('http://rbls.org/%s' % host)

View File

@ -32,6 +32,7 @@ from supybot.test import *
class RblsTestCase(ChannelPluginTestCase):
plugins = ('Rbls',)
config = {'supybot.plugins.Rbls.enable': 'True'}
if network:
def testBan(self):