From 823f49770c5ca432a643ba94f7b43b3c87fe7ab2 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 20 May 2013 19:19:01 +0200 Subject: [PATCH] Rbls: Add supybot.plugins.Rbls.enable. --- Rbls/config.py | 3 +++ Rbls/plugin.py | 2 ++ Rbls/test.py | 1 + 3 files changed, 6 insertions(+) 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):