From 024f4623615b3ddfe959153e412dde17fd244843 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 8 Nov 2003 09:44:04 +0000 Subject: [PATCH] Converted to Configurable. --- plugins/Relay.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/Relay.py b/plugins/Relay.py index ce2376c4a..b1e1c4619 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -91,13 +91,16 @@ def configure(onStart, afterConnect, advanced): afterConnect.append('relay color 2') -class Relay(callbacks.Privmsg, plugins.Toggleable): +class Relay(callbacks.Privmsg, plugins.Configurable): noIgnore = True priority = sys.maxint - toggles = plugins.ToggleDictionary({'color': True}) + configurables = plugins.ConfigurableDictionary( + [('color', plugins.ConfigurableTypes.bool, True, + """Determines whether the bot will color relayed PRIVMSGs so as to + make the messages easier to read."""),] + ) def __init__(self): callbacks.Privmsg.__init__(self) - plugins.Toggleable.__init__(self) self.ircs = {} self._color = 0 self._whois = {} @@ -431,7 +434,7 @@ class Relay(callbacks.Privmsg, plugins.Toggleable): def _formatPrivmsg(self, nick, network, msg): # colorize nicks - color = self.toggles.get('color', msg.args[0]) + color = self.configurables.get('color', msg.args[0]) if color: nick = ircutils.mircColor(nick, *ircutils.canonicalColor(nick)) colors = ircutils.canonicalColor(nick, shift=4)