diff --git a/Rbls/config.py b/Rbls/config.py index 5a0e47a..6d1edf8 100644 --- a/Rbls/config.py +++ b/Rbls/config.py @@ -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: diff --git a/Rbls/plugin.py b/Rbls/plugin.py index 910b064..4bedb49 100644 --- a/Rbls/plugin.py +++ b/Rbls/plugin.py @@ -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) diff --git a/Rbls/test.py b/Rbls/test.py index 30c8cfb..9bacda8 100644 --- a/Rbls/test.py +++ b/Rbls/test.py @@ -32,6 +32,7 @@ from supybot.test import * class RblsTestCase(ChannelPluginTestCase): plugins = ('Rbls',) + config = {'supybot.plugins.Rbls.enable': 'True'} if network: def testBan(self):