plugins/Services: Make ghostDelay configurable with a default of 60 seconds.

This commit is contained in:
James Vega 2006-07-14 20:55:44 +00:00
parent c3cacbce76
commit 9214f6ac87
2 changed files with 7 additions and 5 deletions

View File

@ -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."""))

View File

@ -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 \