From 9214f6ac87da34c3a5a7d517df0bcfabcaaade2a Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 14 Jul 2006 20:55:44 +0000 Subject: [PATCH] plugins/Services: Make ghostDelay configurable with a default of 60 seconds. --- plugins/Services/config.py | 8 +++++--- plugins/Services/plugin.py | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/Services/config.py b/plugins/Services/config.py index a8b3b8581..6fe798925 100644 --- a/plugins/Services/config.py +++ b/plugins/Services/config.py @@ -66,17 +66,19 @@ conf.registerGlobalValue(Services, 'nicks', class Networks(registry.SpaceSeparatedSetOfStrings): List = ircutils.IrcSet - + conf.registerGlobalValue(Services, 'disabledNetworks', Networks(['QuakeNet'], """Determines what networks this plugin will be disabled on.""")) -conf.registerGlobalValue(Services, - 'noJoinsUntilIdentified', +conf.registerGlobalValue(Services, 'noJoinsUntilIdentified', registry.Boolean(False, """Determines whether the bot will not join any channels until it is identified. This may be useful, for instances, if you have a vhost that isn't set until you're identified, or if you're joining +r channels that won't allow you to join unless you identify.""")) +conf.registerGlobalValue(Services, 'ghostDelay', + registry.PositiveInteger(60, """Determines how many seconds the bot will + wait between successive GHOST attempts.""")) conf.registerGlobalValue(Services, 'NickServ', ValidNickOrEmptyString('', """Determines what nick the 'NickServ' service has.""")) diff --git a/plugins/Services/plugin.py b/plugins/Services/plugin.py index 6024e4ce9..08b23b74a 100644 --- a/plugins/Services/plugin.py +++ b/plugins/Services/plugin.py @@ -40,8 +40,6 @@ import supybot.ircutils as ircutils import supybot.schedule as schedule import supybot.callbacks as callbacks -ghostDelay = 60 - class Services(callbacks.Plugin): """This plugin handles dealing with Services on networks that provide them. Basically, you should use the "password" command to tell the bot a nick to @@ -117,6 +115,7 @@ class Services(callbacks.Plugin): return nickserv = self.registryValue('NickServ') password = self._getNickServPassword(nick) + ghostDelay = self.registryValue('ghostDelay') if not nickserv or not password: s = 'Tried to ghost without a NickServ or password set.' self.log.warning(s) @@ -146,6 +145,7 @@ class Services(callbacks.Plugin): return nickserv = self.registryValue('NickServ') password = self._getNickServPassword(nick) + ghostDelay = self.registryValue('ghostDelay') if nick and nickserv and password and \ not ircutils.strEqual(nick, irc.nick): if irc.afterConnect and self.sentGhost is None or \